split-logfile.xml revision c3f8f8b0ccc14b14fbeda7a971593bbbe989fa5b
26939c25250ad2d889339c3389684e5b961df942rbowen<?xml version='1.0' encoding='UTF-8' ?>
26939c25250ad2d889339c3389684e5b961df942rbowen<!DOCTYPE manualpage SYSTEM "/style/manualpage.dtd">
26939c25250ad2d889339c3389684e5b961df942rbowen<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
28124998a7472a188feee6496dd6f42f9b96b0ednd<!-- $LastChangedRevision$ -->
26939c25250ad2d889339c3389684e5b961df942rbowen
26939c25250ad2d889339c3389684e5b961df942rbowen<!--
26939c25250ad2d889339c3389684e5b961df942rbowen Licensed to the Apache Software Foundation (ASF) under one or more
26939c25250ad2d889339c3389684e5b961df942rbowen contributor license agreements. See the NOTICE file distributed with
26939c25250ad2d889339c3389684e5b961df942rbowen this work for additional information regarding copyright ownership.
26939c25250ad2d889339c3389684e5b961df942rbowen The ASF licenses this file to You under the Apache License, Version 2.0
26939c25250ad2d889339c3389684e5b961df942rbowen (the "License"); you may not use this file except in compliance with
26939c25250ad2d889339c3389684e5b961df942rbowen the License. You may obtain a copy of the License at
26939c25250ad2d889339c3389684e5b961df942rbowen
26939c25250ad2d889339c3389684e5b961df942rbowen http://www.apache.org/licenses/LICENSE-2.0
26939c25250ad2d889339c3389684e5b961df942rbowen
26939c25250ad2d889339c3389684e5b961df942rbowen Unless required by applicable law or agreed to in writing, software
26939c25250ad2d889339c3389684e5b961df942rbowen distributed under the License is distributed on an "AS IS" BASIS,
26939c25250ad2d889339c3389684e5b961df942rbowen WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26939c25250ad2d889339c3389684e5b961df942rbowen See the License for the specific language governing permissions and
26939c25250ad2d889339c3389684e5b961df942rbowen limitations under the License.
26939c25250ad2d889339c3389684e5b961df942rbowen-->
26939c25250ad2d889339c3389684e5b961df942rbowen
26939c25250ad2d889339c3389684e5b961df942rbowen<manualpage metafile="other.xml.meta">
26939c25250ad2d889339c3389684e5b961df942rbowen<parentdocument href="./">Programs</parentdocument>
26939c25250ad2d889339c3389684e5b961df942rbowen
26939c25250ad2d889339c3389684e5b961df942rbowen<title>split-logfile - Split up multi-vhost logfiles</title>
26939c25250ad2d889339c3389684e5b961df942rbowen
26939c25250ad2d889339c3389684e5b961df942rbowen<summary>
26939c25250ad2d889339c3389684e5b961df942rbowen <p>This perl script will take a combined Web server access log file and
26939c25250ad2d889339c3389684e5b961df942rbowen break its contents into separate files. It assumes that the first field of
26939c25250ad2d889339c3389684e5b961df942rbowen each line is the virtual host identity, put there using the "<code>%v</code>"
26939c25250ad2d889339c3389684e5b961df942rbowen variable in <directive module="mod_log_config">LogFormat</directive>.
26939c25250ad2d889339c3389684e5b961df942rbowen </p>
26939c25250ad2d889339c3389684e5b961df942rbowen</summary>
26939c25250ad2d889339c3389684e5b961df942rbowen
26939c25250ad2d889339c3389684e5b961df942rbowen<section id="split-logfile"><title>Usage</title>
26939c25250ad2d889339c3389684e5b961df942rbowen
26939c25250ad2d889339c3389684e5b961df942rbowen <p>Create a log file with virtual host information in it:</p>
26939c25250ad2d889339c3389684e5b961df942rbowen
c3f8f8b0ccc14b14fbeda7a971593bbbe989fa5bhumbedooh <highlight language="config">
c3f8f8b0ccc14b14fbeda7a971593bbbe989fa5bhumbedoohLogFormat "%v %h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-agent}i\"" combined_plus_vhost
c3f8f8b0ccc14b14fbeda7a971593bbbe989fa5bhumbedoohCustomLog logs/access_log combined_plus_vhost
c3f8f8b0ccc14b14fbeda7a971593bbbe989fa5bhumbedooh </highlight>
26939c25250ad2d889339c3389684e5b961df942rbowen
26939c25250ad2d889339c3389684e5b961df942rbowen <p>Log files will be created, in the directory where you run the
26939c25250ad2d889339c3389684e5b961df942rbowen script, for each virtual host name that appears in the combined log file.
26939c25250ad2d889339c3389684e5b961df942rbowen These logfiles will named after the hostname, with a
26939c25250ad2d889339c3389684e5b961df942rbowen <code>.log</code> file extension.</p>
26939c25250ad2d889339c3389684e5b961df942rbowen
26939c25250ad2d889339c3389684e5b961df942rbowen <p>The combined log file is read from stdin. Records read will be appended
26939c25250ad2d889339c3389684e5b961df942rbowen to any existing log files.</p>
26939c25250ad2d889339c3389684e5b961df942rbowen
26939c25250ad2d889339c3389684e5b961df942rbowen <example>split-logfile &lt; access_log</example>
26939c25250ad2d889339c3389684e5b961df942rbowen
26939c25250ad2d889339c3389684e5b961df942rbowen
26939c25250ad2d889339c3389684e5b961df942rbowen</section>
26939c25250ad2d889339c3389684e5b961df942rbowen
26939c25250ad2d889339c3389684e5b961df942rbowen</manualpage>