allinurl / goaccess

GoAccess is a real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser.

Home Page:https://goaccess.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No date format was found on your conf file

andy15703166 opened this issue · comments

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

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.

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.

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.

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

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

Thank you for help!

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

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

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.

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"

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.

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!

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"

@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...

@allinurl oh i forgot line 12 big thx!

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

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

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

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

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

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

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.

@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?

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

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?

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

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?

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

@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.

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

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