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

Can't create log-format for Nginx logs #1651

Open
oleh-dizhak opened this issue Jan 15, 2020 · 3 comments
Open

Can't create log-format for Nginx logs #1651

oleh-dizhak opened this issue Jan 15, 2020 · 3 comments

Comments

@oleh-dizhak
Copy link

@oleh-dizhak oleh-dizhak commented Jan 15, 2020

Hello guys!

I have a problems with parsing Nginx log file using goaccess. Please can you help me to create the correct log-format:

For example:

87.122.79.139 - - [14/Dec/2019:06:25:07 +0000] "GET /de/customer/section/load/?sections=cart&update_section_id=false&_=1576304716413 HTTP/1.1" 200 717 "https://www.womanizer.com/de/so-funktionierts" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0"
66.249.69.86 - - [14/Dec/2019:06:25:07 +0000] "GET /gl/rest/V1/geo/country HTTP/1.1" 200 35 "https://www.womanizer.com/gl/" "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
87.122.79.139 - - [14/Dec/2019:06:25:08 +0000] "GET /de/customer/section/load/?sections=cart&update_section_id=false&_=1576304716414 HTTP/1.1" 200 718 "https://www.womanizer.com/de/so-funktionierts" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0"
24.134.40.189 - - [14/Dec/2019:06:25:18 +0000] "GET /gl/rest/V1/geo/country HTTP/1.1" 200 35 "https://www.womanizer.com/de/womanizer-starlet-2?gclid=EAIaIQobChMI3_Lr0cC05gIVS7DtCh125Q5EEAAYASAAEgJAGvD_BwE" "Mozilla/5.0 (Linux; Android 6.0.1; SAMSUNG SM-T555) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/10.2 Chrome/71.0.3578.99 Safari/537.36"
87.122.79.139 - - [14/Dec/2019:06:25:18 +0000] "GET /de/customer/section/load/?sections=cart&update_section_id=false&_=1576304726084 HTTP/1.1" 200 718 "https://www.womanizer.com/de/womanizer-classic" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0"

Thank you so much!

@allinurl

This comment has been minimized.

Copy link
Owner

@allinurl allinurl commented Jan 15, 2020

This should work:

goaccess access.log --log-format=COMBINED
@oleh-dizhak

This comment has been minimized.

Copy link
Author

@oleh-dizhak oleh-dizhak commented Jan 15, 2020

@allinurl I have the error message:

Parsed 1 linesproducing the following errors:
Token '14/Dec/2019' doesn't match specifier '%d'
Format Errors - Verify your log/date/time format

Thanks!

@allinurl

This comment has been minimized.

Copy link
Owner

@allinurl allinurl commented Jan 15, 2020

Seems like your log has english dates but your machine different locale.

LANG="en_US.UTF-8" bash -c 'goaccess access.log --log-format=COMBINED'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.