split-logfile.in revision abd59e84ca9ccb25105f06809c18a8afc9e40e7b
2N/A# Licensed to the Apache Software Foundation (ASF) under one or more 2N/A# contributor license agreements. See the NOTICE file distributed with 2N/A# this work for additional information regarding copyright ownership. 2N/A# The ASF licenses this file to You under the Apache License, Version 2.0 2N/A# (the "License"); you may not use this file except in compliance with 2N/A# the License. You may obtain a copy of the License at 2N/A# Unless required by applicable law or agreed to in writing, software 2N/A# distributed under the License is distributed on an "AS IS" BASIS, 2N/A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2N/A# See the License for the specific language governing permissions and 2N/A# limitations under the License. 2N/A# This script will take a combined Web server access 2N/A# log file and break its contents into separate files. 59N/A# It assumes that the first field of each line is the 2N/A# virtual host identity (put there by "%v"), and that 2N/A# the logfiles should be named that+".log" in the current 2N/A# The combined log file is read from stdin. Records read 2N/A# will be appended to any existing log files. 2N/A # Get the first token from the log record; it's the 2N/A # identity of the virtual host to which the record 38N/A # Normalize the virtual host name to all lowercase. 181N/A # If it's blank, the request was handled by the default 26N/A # server, so supply a default name. This shouldn't 26N/A # happen, but caution rocks. 26N/A # if the vhost contains a "/" or "\", it is illegal so just use 26N/A # the default log to avoid any security issues due if it is interprted 26N/A # as a directory separator. 26N/A # If the log file for this virtual host isn't opened 26N/A # Strip off the first token (which may be null in the 2N/A # case of the default server), and write the edited 26N/A # record to the current log file.