[SlugBug] perl help required - helix server log parsing
Chris J
cej at nightwolf.org.uk
Fri Jun 18 15:00:38 BST 2004
>
> have given your above script a try, Chris, but webalizer again failed
> with the error:
>
> Skipping bad records (xxxxx)
> Skipping bad records (xxxxx)
> Skipping bad records (xxxxx)
> No valid records found!
>
> and this is some output that i have from your script:
>
> 192.168.1.26 - - [18/Jun/2004:04:06:17 +0000] "GET
> ramgen/encoder/zetafm.rm HTTP/1.0" 200 0 "-"
Try this instead then. It could be that the two spaces between the date/time
and the "GET ..." is causing problems (next four as one):
sed -e 's/^\(.*\[.*\].*\)\[\(.*\)\] \[.*\] \[.*\].*/\1\"-\" \"\2\"/'
-e 's/ / /g'
< helix_log_file.log
> sane_log_file.log
This replaces /all/ instances of two spaces with a single space. To only
home in on the one in the leadup to the GET we can try replacing the second
substitute expression (the 's/ / /g') with: 's/ \(\"GET\)/ \1/'
Try one (or both) and see if that helps?
Chris...
--
\ Chris Johnson \
\ cej at nightwolf.org.uk ~-----,
\ http://cej.nightwolf.org.uk/ ~-----------------------------------,
\ Redclaw chat - http://redclaw.org.uk - telnet redclaw.org.uk 2000 \____
More information about the SlugBug
mailing list