]> granicus.if.org Git - apache/blob - docs/manual/programs/split-logfile.xml
rebuild
[apache] / docs / manual / programs / split-logfile.xml
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$ -->
5
6 <!--
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
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
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.
21 -->
22
23 <manualpage metafile="split-logfile.xml.meta">
24 <parentdocument href="./">Programs</parentdocument>
25
26 <title>split-logfile - Split up multi-vhost logfiles</title>
27
28 <summary>
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>.
33     </p>
34 </summary>
35
36 <section id="split-logfile"><title>Usage</title>
37
38     <p>Create a log file with virtual host information in it:</p>
39
40     <highlight language="config">
41 LogFormat "%v %h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-agent}i\"" combined_plus_vhost
42 CustomLog logs/access_log combined_plus_vhost
43     </highlight>
44
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>
49
50     <p>The combined log file is read from stdin. Records read will be appended
51     to any existing log files.</p>
52
53     <example>split-logfile &lt; access_log</example>
54
55
56 </section>
57
58 </manualpage>