SH script to split squid log by date
Hi,
I really need your help to make a script to split a large squid's log file into a multiple files, each of them containing the log entries for every logged date.
To achieve the result I planned to use the function "date" with the first log field as a parameter using this syntax:
date -d @(ten number squid timestamp field) +%F
to obtain the desired filename for splitted logs.
Example:
# date -d @1232163496 +%F
will return: 2009-01-16
The idea is to analize the first field of each line in the log file and append whole line to the corresponding file.
Any help would be apreciated,
I'm a newbie ¿Someone can help me?
Last edited by _MCRH_; 01-28-2009 at 05:02 PM..
Reason: Before close it
|