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