Skip to content
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

How can I pass custom nginx log format to GoAccess #2721

Open
erencanss opened this issue Sep 21, 2024 · 2 comments
Open

How can I pass custom nginx log format to GoAccess #2721

erencanss opened this issue Sep 21, 2024 · 2 comments

Comments

@erencanss
Copy link

My sample logs are here. Could you help me?

83.99.151.67 - - [19/Sep/2024:06:25:03 +0300] GET /brillant-akilli-tul-perde-bebeksi-mavi-renkli-tul-dikey-zebra-perde-duz-1-kalite/67970.html HTTP/1.1 "200" 72151 "-" "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; GeedoProductSearch; +http://www.geedo.com/product-search.html) Chrome/79.0.3945.88 Safari/537.36" "www.eperde.com to: 192.168.100.99:80" rt="0.489" uct="0.000" uht="0.492" urt="0.492"

@0bi-w6n-K3nobi
Copy link
Contributor

0bi-w6n-K3nobi commented Sep 21, 2024

Hi @erencanss ...

Do you can try:

LANG="en_US.UTF-8" LC_TIME="en_US.UTF-8"  \
  goaccess LOGFILE  \
    --log-format='%h %^[%x] %m %U %H "%s" %b "%R" "%u" "%v %^" rt="%T" utc="%^" uht="%^" urt="%^"'  \
    --datetime-format='%d/%b/%Y:%H:%M:%S %z'  \
    --output REPORT.html

or into goaccess.conf (without quotes) :

log-format %h %^[%x] %m %U %H "%s" %b "%R" "%u" "%v %^" rt="%T" utc="%^" uht="%^" urt="%^"
datetime-format '%d/%b/%Y:%H:%M:%S %z

Well... You need choice what those values between rt, utc, uht or urt that will be show.
I choiced rt is more coherent, but if you what another just exchange "%T" with new field.

@erencanss
Copy link
Author

Hi @erencanss ...

Do you can try:

LANG="en_US.UTF-8" LC_TIME="en_US.UTF-8"  \
  goaccess LOGFILE  \
    --log-format='%h %^[%x] %m %U %H "%s" %b "%R" "%u" "%v %^" rt="%T" utc="%^" uht="%^" urt="%^"'  \
    --datetime-format='%d/%b/%Y:%H:%M:%S %z'  \
    --output REPORT.html

or into goaccess.conf (without quotes) :

log-format %h %^[%x] %m %U %H "%s" %b "%R" "%u" "%v %^" rt="%T" utc="%^" uht="%^" urt="%^"
datetime-format '%d/%b/%Y:%H:%M:%S %z

Well... You need choice what those values between rt, utc, uht or urt that will be show. I choiced rt is more coherent, but if you what another just exchange "%T" with new field.

It works. Thank you for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants