2010/3/10 Claes Wikstrom <klacke@tail-f.com>
Daniel Fahlke wrote:
Hi, i have a Question to the log format.

In the man page to the config stands, that the "Common Log Format" is used.
Means that the format of apache(because it is so popular)?



Yes,


I ask, because i wanted to use an log analyzer, but it only find invalid entries.

Which analyzer, I've used several different ananlyzers on the yaws logs
over the years.



After comparing yaws access log and apache access log i find, that there is a little difference.

this is a yaws entry:
 207.46.13.85 - - 10/Mar/2010:07:43:04 +0100 "GET /Beitrag.php?ID=3 HTTP/1.1" 200 3 "-" "msnbot/2.0b (+http://search.msn.com/msnbot.htm)"

this a apache entry:
 66.249.71.45 - - [09/Mar/2010:17:36:19 +0300] "GET /service/popup/popup/index.php HTTP/1.1" 200 3756 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"


the differenze is at the date, yaws dont place brackets.


Interesting,


Is this a Bug or a feature?


It actually looks as a bug.

http://en.wikipedia.org/wiki/Common_Log_Format



I've fixed it in git.

http://github.com/klacke/yaws/commit/9dfb58e75e6ce8f664b9ead08c6d3da7488398fc

Thanks for reporting

/klacke



No problem. for the case, anyone want to correct his older logfiles, i wrote a lttle shell script to make this. It should make it for the most entries


sed -r -e 's/- - (.*)( "GET| "POST| "HEAD| "CONNECT)/- - [\1]\2/'  /path/to/access.log > /path/to/correct_access.log