allinurl / goaccess

GoAccess is a real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser.
https://goaccess.io
MIT License
18.38k stars 1.11k forks source link

OpenLiteSpeed NCSA extended/combined #2294

Closed Lennart01 closed 2 years ago

Lennart01 commented 2 years ago

Hey, I've been trying to get my log files parsed correctly but I can't get the user agents to be parsed correctly and keep ending up with "Unknown". Example log: "ip - directory [15/Mar/2022:03:31:12 +0100] "GET /directory/test.mp4 HTTP/1.1" 200 1004594 "https://iamaref.com/test/test" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36" I am using the following log format: --log-format='"%h - %l %^[%d:%t %^] "%r" %>s %b "%{Referer}i" "%{User-Agent}i"' --date-format=%d/%b/%Y --time-format=%T I guess the User-Agent format doesn't exactly match the format used by goaccess. Any help is appreciated :).

0bi-w6n-K3nobi commented 2 years ago

Hi @Lennart01 ..

You've come close... That's almost it. Try this: --log-format='"%h %^[%d:%t %^] "%r" %s %b "%R" "%u"' --data-format...

Lennart01 commented 2 years ago

thank you very much. That worked perfectly.

0bi-w6n-K3nobi commented 2 years ago

Hio @Lennart01

Some tips for your studies...

For C and C++, I suggest the author Herbert Schildt. The books C: The Complete Reference and C++: The Complete Reference are greats! Several tips and tricks that it took me a long time to learn on my own.

Well... I work at Linux at two decades, and did have some prejudice about C# and M$cr0ft... But today, all turn on free software and, I believe C# is natural evolution for who work with C++.

Success in your studies.