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

No date format was found on your conf file #136

Closed
andy15703166 opened this issue Jul 8, 2014 · 31 comments
Closed

No date format was found on your conf file #136

andy15703166 opened this issue Jul 8, 2014 · 31 comments

Comments

@andy15703166
Copy link

When I run “goaccess -f access_log -a > report.html” It alerts:

Error occured at: parser.c - parse_log - 1043
No date format was found on your conf file.

How can I make it work? Thank you

@allinurl
Copy link
Owner

allinurl commented Jul 8, 2014

Did you uncomment the date-format time-format and log-format under your /etc/goaccess.conf? or ~/.goaccessrc? I'm assuming you are using the latest version.

@andy15703166
Copy link
Author

Well,at first I have to say thank you for your help.
Depending on your advice,I run the command again but this time there is a alert that:

"Fatal error has occurred
Error occured at: goaccess.c - main - 883
Nothing valid to process."

How to do that?
Thank you very very much.

@allinurl
Copy link
Owner

allinurl commented Jul 8, 2014

Can you post the log/time/date format that you are currently using and if you could post a sample line from your access log would be great.

@andy15703166
Copy link
Author

Of cause.
There is a sample line below:

209.222.8.51 - - [08/Jul/2014:04:13:21 +0800] "GET /com/qzmm/psell/itemid-7589.html HTTP/1.1" 200 9531

@allinurl
Copy link
Owner

allinurl commented Jul 9, 2014

The following log format should do it (NCSA Combined Log Format):

%h %^[%d:%^] "%r" %s %b "%R" "%u"

the following date format

%d/%b/%Y

and time format

%T

@andy15703166
Copy link
Author

Thank you for help!

@allinurl
Copy link
Owner

allinurl commented Jul 9, 2014

Closing it. Feel free to open a new issue if needed.

@allinurl allinurl closed this as completed Jul 9, 2014
@FrontierPsychiatrist
Copy link

I get the same error message even though I'm passing a date format via the --date-format parameter.

goaccess --log-format="%h %^[%d:%^] \"%r\" %s %b \"%R\" \"%u\"" --date-format=%d/%b/%Y -f 2015.log

@allinurl
Copy link
Owner

Try passing --no-global-config. Also, what version are you using? Feel free to post a few lines from your access log if that does not do it.

@FrontierPsychiatrist
Copy link

That also didn't help. Here's the version I'm using:
GoAccess - version 0.9 - Apr 15 2015 01:59:02

I've installed it via homebrew under OSX Yosemite, meaning the global config is in /usr/local/etc

This happend after the update I think (hadn't used it in a while). I also tried uncommenting the lines in the config but that still didn't work.

Also, I'm redirecting the output to an HTML file. If I open the log file in the ncurses mode it works.

Here are some lines from the log

188.165.15.97 - - [01/Apr/2015:01:05:04 +0200] "GET /api/0.5.0/api.html HTTP/1.1" 200 21907 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)"
2.106.55.68 - - [01/Apr/2015:01:32:07 +0200] "GET / HTTP/1.1" 200 4282 "https://www.google.dk/" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36"
2.106.55.68 - - [01/Apr/2015:01:32:07 +0200] "GET /css/main.css HTTP/1.1" 200 97 "http://www.node-spotify.com/" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36"

@allinurl
Copy link
Owner

Could you try uncommenting the log, date and time format from your config file and using -p /path/goaccess.conf and see if that works. It sounds like the config file is overwriting the command line options.

@FrontierPsychiatrist
Copy link

Ok, I feel a bit stupid now, I didn't get the exact same error message, actually the time format was missing. So I added --time-format=... to my call and everything's perfect. Sorry for wasting your time!

@warb2n
Copy link

warb2n commented Jul 7, 2015

Hello!
When i update my access i have error

Fatal error has occurred
Error occured at: src/parser.c - verify_formats - 1691
No time format was found on your conf file.

I use nginix and i have access 0.9.2 with stand. config file. What i need to do?

I try uncomment this but not working =@

date-format %d/%b/%Y
log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u"

@allinurl
Copy link
Owner

allinurl commented Jul 7, 2015

@warb2n you will need to edit your goaccess config file (v0.9.2) and make sure to uncomment line 12 and 28, 48. Here's more info about this: http://goaccess.io/faq#howto-config

Let me know how it goes...

@warb2n
Copy link

warb2n commented Jul 7, 2015

@allinurl oh i forgot line 12 big thx!

@iam-jay
Copy link

iam-jay commented Oct 22, 2015

I have commentated line for date format as well as log format but ti doesn't work

@allinurl
Copy link
Owner

@jayprakashstar Can you please post your config file and the location of it, e.g., /etc/goaccess.conf, ~/.goaccessrc.

@iam-jay
Copy link

iam-jay commented Oct 22, 2015

time-format %H:%M:%S

date-format %d/%b/%Y

log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u"

My file is around 10 GB

@allinurl
Copy link
Owner

Please make sure, you are using the right config file. You can use goaccess -f log -p /path/config/file.

@iam-jay
Copy link

iam-jay commented Oct 23, 2015

Yes I am using same. Now it is killing process in middle.

@allinurl
Copy link
Owner

Please open a new issue and specify the problem(s) you are having, and the version of goaccess you are using.

@VictorioBerra
Copy link

Id like to comment to say that its really weird after a fresh install goaccess -f logfile.log works just fine and shows a GUI for choosing the format but cat logfile.log | goaccess requires all these config options to be set.

@allinurl
Copy link
Owner

@LordWingZero This is due to the redirect when outputting to a file. So for instance,

goaccess -f logfile -o json > output.json

If at that point ncurses is initialized, then it will mess up the output. I guess it could check if it's outputting to a file, otherwise display the config file as in the example that you posted. This could be related to #53. Thoughts?

@benjaoming
Copy link
Contributor

benjaoming commented Sep 19, 2017

Tip for this issue: Get a newer version of goaccess. They will at least display non-parseable output so you get a sense of where the issue is.

I got pretty upset when I found out I needed a double space in %^[%d:%t %^] "%r" right after ]. This was in order to parse a default Nginx configuration on Ubuntu 14.04, I kid you not.. I mean upset at the Nginx configuration, not Goaccess :)

My final working log-format is:

log-format %h %^[%d:%t %^]  "%r" %s %b "%R" "%u" %L

@dms-vkuschev
Copy link

dms-vkuschev commented Oct 5, 2017

The same problem.
log is:
[u][05/Oct/2017:00:00:01 +0300] 0.350 0.450 200 188.162.36.133 klubki-v-korzinke.ru GET /category/alize-alize/ HTTP/1.1 "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko" "http://klubki-v-korzinke.ru/reviews/" 48191 141.8.195.253 klubkivkor
What log-format i must use?

@allinurl
Copy link
Owner

allinurl commented Oct 6, 2017

@dms-vkuschev Can you please describe the fields in your log format?

@nad2000
Copy link

nad2000 commented Jul 9, 2018

I ran into the same issue. My .goaccessrc:

time-format %T
date-format %d/%b/%Y
log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u" %D

When I ran goaccess access_log -o report.html, I got:

GoAccess - version 1.2 - Mar 7 2017 06:40:58
Config file: /etc/goaccess.conf

Fatal error has occurred
Error occured at: src/parser.c - parse_log - 2705
No time format was found on your conf file.

I also tried with time-format %H:%M:%S...

When I ran goaccess access_log and entered the same format string in dialog, everything works fine :(
Any ideas what could be wrong?

@benjaoming
Copy link
Contributor

@nad2000 Where are your logs from? See my post right above about the double space?

@nad2000
Copy link

nad2000 commented Jul 10, 2018

@benjaoming , my bad, well, in a way. I was operating under the assumption that the user configuration in the home directory (~/.goaccessrc) overrides the default one seamlessly by default. I reckon it was a reasonable assumption. It turns out it should be given explicitly using -p/--config-file=<filename> (Custom configuration file). Running goaccess access_log -o report.html -p ~/.goaccessrc SOLVED the issue.

@allinurl
Copy link
Owner

@nad2000 I think this issue was fixed upstream. Please feel free to build from development to test this out. Thanks!

@omidraha
Copy link

Worked for me:

$ goaccess -f nginx.log --log-format="%h %^[%d:%^] \"%r\" %s %b \"%R\" \"%u\"" --date-format="%d/%b/%Y" --time-format="%T" -a > report.html

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

10 participants