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

Skip/Ignore lines with Format Errors #891

Closed
vivekkrish opened this issue Sep 20, 2017 · 3 comments
Closed

Skip/Ignore lines with Format Errors #891

vivekkrish opened this issue Sep 20, 2017 · 3 comments

Comments

@vivekkrish
Copy link

Hello,

I was wondering if it is possible to configure goaccess (via a command-line parameter) to ignore any lines in the log file that produced an error from parsing (since they didn't adhere to the defined format)?

This way, it can process, analyze and report all the lines that were parsed successfully and generate the report, as opposed to terminating the process with the Format Errors - Verify your log/date/time format error message and generating no results.

I looked through the GitHub issue list, the man page and FAQs on the site, and didn't notice anything which allows this kind of functionality. Is this possible at all?

Thank you very much for creating this wonderful tool!

@allinurl
Copy link
Owner

If you are on the latest version, you can try using --num-test=0. When set to 0, the parser won't test any lines and will parse the whole access log.

@vivekkrish
Copy link
Author

Wow! Thanks for the super quick response. Yes, I'm on the latest version. I will definitely try out the --num-tests param and get back to you.

Looking back at the man page online, I did read this snippet:

--num-tests=<number>
Number of lines from the access log to test against the provided log/date/time format. By default, the parser is set to test 10 lines. If set to 0, the parser won't test any lines and will parse the whole access log. If a line matches the given log/date/time format before it reaches number, the parser will consider the log to be valid, otherwise GoAccess will return EXIT_FAILURE and display the relevant error messages.

But surprisingly, with this default setting of 10, the parser was failing even when just 2 lines (out of a 100000 line log file) had an error.

Will test your suggestion and get back to you soon. Thanks!

@vivekkrish
Copy link
Author

Happy to report that your suggestion works perfectly! Thank you very much.

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

No branches or pull requests

2 participants