-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GoAccess with haproxy #2763
Comments
Perfect. Thank you! |
I'm playing around with goaccess and haproxy. I've not had any luck with geoip yet.. I also discovered that haproxy could be tweaked to include referrer and user agent in the logs ([https://serverfault.com/questions/764098/haproxy-log-custom-format-for-goaccess]). Here are some more sample logs... I attempted to build the goaccess query starting simple, but am struggling and could not get it right. Can you help me with a logical method to build a custom format query? I would like to be able to do this myself. Thanks! |
I am struggling with getting goaccess to generate a report from a HAproxy log as well, and I'm really lost as to why Example log outputs: Goaccess config: Error: I've made sure that the containers for syslog, haproxy and goaccess all have en_US.UTF-8 locale, I've also tried adding --tz=UTC parameter. I'm really confused as to why it won't accept 04 as a %d specifier |
This is because the specifiers used by the I was able to parse your example output with the following configuration:
|
In the future, please try to provide a failing log format that you tried—as you did in the initial issue description—since it gives those want to assist a solid place to start, and helps them understand what each part of your log may represent. In this case, I modified the log format provided in the accepted answer of the linked Stack Overflow question. SolutionGiven the following log entry:
We can add the following lines to our GoAccess configuration file:
Or pass those same options as arguments to the
See my other comment on this issue for an overview of the different log specifiers, and how they differ slightly depending on the option being set. |
Thank you, that helped. I now have a better understanding of constructing a query on my own. |
I'm requesting guidance with parsing haproxy logs with goaccess.
Here are a couple of formating attempts, however, all attempts keep returning errors at every step.
goaccess -f haproxy.log --log-format='%^ %^ %^:%^:%^ %^ %^[%^]: %h:%^ [%d:%t.%^] %^ %^ %^/%^/%^/%^/%L %s %b %^ %^ %^ %^/%^/%^/%^/%^ %^/%^ "%r"' --date-format='%d/%b/%Y' --time-format='%H:%M:%S' -q
goaccess -f haproxy.log --log-format='%^]%^ %h:%^ [%d:%t.%^] %^/%^/%^/%^/%L/%^ %s %b %^"%r"' --date-format='%d/%b/%Y' --time-format='%H:%M:%S' -q
Here are a few sample lines of the logs..
And here's the log format breakdown which I hope I've got right:
The text was updated successfully, but these errors were encountered: