Scroll to navigation

cronosplit(1m) cronosplit(1m)


cronosplit - split log files into cronolog-compatible files


cronosplit --template=TEMPLATE [--print-invalid] [--help] [--version] file ...


cronosplit is a simple program that reads lines from a set of input log files, which must be in Common Log Format or NCSA Combined/XLF/ELF Format and write each lines to an output files, the name of which is constructed using the template specified and timestamp from the the line. The template uses the same format specifiers as the Unix date(1) command (which are the same as the standard C strftime library function).


cronosplit accepts the following options and arguments:

specifies the template for the output log files (using the format specifiers described below).
print invalid log file entries to the standard error stream.
update modification time of output file according to last parsed log entry.
print additional status messages to the standard error stream.
print debug messages to the standard error stream.
print a help message and then exit.
print version information and exit.

Template format

Each character in the template represents a character in the expanded filename, except for date and time format specifiers, which are replaced by their expansion. Format specifiers consist of a `%' followed by one of the following characters:

a literal % character
a new-line character
a horizontal tab character

Time fields:

hour (00..23)
hour (01..12)
the locale's AM or PM indicator
minute (00..59)
second (00..61, which allows for leap seconds)
the locale's time representation (e.g.: "15:12:47")
time zone (e.g. GMT), or nothing if the time zone cannot be determined

Date fields:

the locale's abbreviated weekday name (e.g.: Sun..Sat)
the locale's full weekday name (e.g.: Sunday .. Saturday)
the locale's abbreviated month name (e.g.: Jan .. Dec)
the locale's full month name, (e.g.: January .. December)
the locale's date and time (e.g.: "Sun Dec 15 14:12:47 GMT 1996")
day of month (01 .. 31)
day of year (001 .. 366)
month (01 .. 12)
week of the year with Sunday as first day of week (00..53, where week 1 is the week containing the first Sunday of the year)
week of the year with Monday as first day of week (00..53, where week 1 is the week containing the first Monday of the year)
day of week (0 .. 6, where 0 corresponds to Sunday)
locale's date representation (e.g. today in Britain: "12/04/96")
year without the century (00 .. 99)
year with the century (1970 .. 2038)

Other specifiers may be available depending on the C library's implementation of the strftime function.


apache(1m) cronolog(1m) date(1) strftime(3) environ(5)

More information and the latest version of cronolog and cronosplit can be obtained from

If you have any suggestions, bug reports, fixes, or enhancements, please mail them to the author.

More about Apache

Documentation for the Apache http server is available from


Andrew Ford <>

cronosplit is based on a script called splitlog by Roy Fielding, which is part of the wwwstat package.

March 1998