split-logfile.html.en revision aaed4ebc116f5862aff2610a809a9a9e9a28f50e
55cf6e01272ec475edea32aa9b7923de2d36cb42Christian Maeder<?xml version="1.0" encoding="ISO-8859-1"?>
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder This file is generated from xml source: DO NOT EDIT
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder -->
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<title>split-logfile - Split up multi-vhost logfiles - Apache HTTP Server Version 2.5</title>
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="/style/css/prettify.css" />
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<script src="/style/scripts/prettify.min.js" type="text/javascript">
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder</script>
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<link href="/images/favicon.ico" rel="shortcut icon" /></head>
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<body id="manual-page" class="no-sidebar"><div id="page-header">
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<p class="apache">Apache HTTP Server Version 2.5</p>
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<img alt="" src="/images/feather.gif" /></div>
c04cc42aa672aa49b45005e6eed77cc80e0d6ae0Christian Maeder<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
329c739bc05b8ce8d54f81071d0826ff771d1f78Christian Maeder<div id="path">
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.5</a> &gt; <a href="./">Programs</a></div><div id="page-content"><div id="preamble"><h1>split-logfile - Split up multi-vhost logfiles</h1>
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<div class="toplang">
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<p><span>Available Languages: </span><a href="/en/programs/split-logfile.html" title="English">&nbsp;en&nbsp;</a></p>
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder</div>
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder <p>This perl script will take a combined Web server access log file and
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder break its contents into separate files. It assumes that the first field of
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder each line is the virtual host identity, put there using the "<code>%v</code>"
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder variable in <code class="directive"><a href="/mod/mod_log_config.html#logformat">LogFormat</a></code>.
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder </p>
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder</div>
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<div class="section">
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<h2><a name="split-logfile" id="split-logfile">Usage</a></h2>
ac4396c9f44a76c5c97925954ee49b4a91d8dd88Christian Maeder
ac4396c9f44a76c5c97925954ee49b4a91d8dd88Christian Maeder <p>Create a log file with virtual host information in it:</p>
ac4396c9f44a76c5c97925954ee49b4a91d8dd88Christian Maeder
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder <pre class="prettyprint lang-config">LogFormat "%v %h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-agent}i\"" combined_plus_vhost
c04cc42aa672aa49b45005e6eed77cc80e0d6ae0Christian MaederCustomLog "logs/access_log" combined_plus_vhost</pre>
c04cc42aa672aa49b45005e6eed77cc80e0d6ae0Christian Maeder
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder
a65c6747c9acbbebc93baba7bae94d2e3d8cdafbTill Mossakowski <p>Log files will be created, in the directory where you run the
a38f3d84e592184830fa308c5dab3f7c71e4464fChristian Maeder script, for each virtual host name that appears in the combined log file.
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder These logfiles will named after the hostname, with a
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder <code>.log</code> file extension.</p>
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder <p>The combined log file is read from stdin. Records read will be appended
329c739bc05b8ce8d54f81071d0826ff771d1f78Christian Maeder to any existing log files.</p>
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder <div class="example"><p><code>split-logfile &lt; access_log</code></p></div>
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder
4bbd808612c2580ae6e0495a155997a6bb47ecf3Christian Maeder
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder</div></div>
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<div class="bottomlang">
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<p><span>Available Languages: </span><a href="/en/programs/split-logfile.html" title="English">&nbsp;en&nbsp;</a></p>
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder</div><div class="top"><a href="#page-header"><img src="/images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<script type="text/javascript"><!--//--><![CDATA[//><!--
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maedervar comments_shortname = 'httpd';
c04cc42aa672aa49b45005e6eed77cc80e0d6ae0Christian Maedervar comments_identifier = 'http://httpd.apache.org/docs/trunk/programs/split-logfile.html';
d6c6b2543c509ec7f6213e4cba675d96304a7fd6Christian Maeder(function(w, d) {
d6c6b2543c509ec7f6213e4cba675d96304a7fd6Christian Maeder if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder d.write('<div id="comments_thread"><\/div>');
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder var s = d.createElement('script');
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder s.type = 'text/javascript';
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder s.async = true;
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder }
d9be582b00d420e2fe0737fcb07c9aa3d235a774Christian Maeder else {
19defe35cc864caeb98dd4ea1d429b1f989ecdffChristian Maeder d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
7857a35e3af533dfbd0f0e18638ebd211e6358a0Christian Maeder }
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder})(window, document);
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder//--><!]]></script></div><div id="footer">
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<p class="apache">Copyright 2015 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maederif (typeof(prettyPrint) !== 'undefined') {
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder prettyPrint();
19defe35cc864caeb98dd4ea1d429b1f989ecdffChristian Maeder}
19defe35cc864caeb98dd4ea1d429b1f989ecdffChristian Maeder//--><!]]></script>
bff4b3f816be4c1e1d8ded76f1d5af786839e1a9Christian Maeder</body></html>