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 time format was found on your conf file. #328

Closed
coverguy opened this issue Oct 27, 2015 · 34 comments
Closed

No time format was found on your conf file. #328

coverguy opened this issue Oct 27, 2015 · 34 comments
Labels

Comments

@coverguy
Copy link

Hi,

I am currently running on GoAccess v0.9.6 and installed on Centos 6.5 (Final) server.

whenever i try to run my log using "goaccess -f logfile" (without .log)

I get the error as below:-

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

I have change the date-format and log-format respectively:-

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

No luck and keeps getting the same error....Need your kind advice on this.

Here is my config file settings:-

######################################
# Time Format Options (required)
######################################
#time-format %H:%M:%S
#time-format %T
#   
#   
#time-format %f

######################################
# Date Format Options (required)
######################################
# Apache log date format. The following date format works with any 
# of the Apache's log formats below.
#   
date-format %d/%b/%Y
#   
#date-format %Y-%m-%d
#   
#   
#date-format %f

######################################
# Log Format Options (required)
######################################
#   
#   
# NCSA Combined Log Format
#   
#log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u"
log-format %h %^[%d:%^] "%r" %s %b "%R" "%u"

Thanks.

@coverguy
Copy link
Author

My Log pattern are as below, just in case you might need it:-

192.168.x.x - anonymous [27/Oct/2015:17:49:16 +0800]

@allinurl
Copy link
Owner

As the error message says, it couldn't find the time-format. You need to uncomment the following line:

time-format %H:%M:%S

@coverguy
Copy link
Author

I tried but the error still persists..

@allinurl
Copy link
Owner

You may need to specify the config file using -p /path/goaccess.conf. It might be picking ~/.goaccessrc. You can also run goaccess --dcf and that will tell you which config file will use if no -p is passed.

@allinurl
Copy link
Owner

BTW, above the Fatal error has occurred message, it should also display the config file being used.

@coverguy
Copy link
Author

So you mean just type "goaccess -p /path/goaccess.conf only?

@allinurl
Copy link
Owner

You will need to specify the log file with -f and the path of your config file with -p

goaccess -f /path/logfile -p /path/goaccess.conf

If there's no time/log/date formats, goaccess should prompt a dialog asking for these formats, unless you are piping a log to it, i.e., cat logfile | goaccess

@coverguy
Copy link
Author

Here is my diagnostics as below:

[root@xxxx home]# goaccess --dcf
/usr/local/etc/goaccess.conf

goaccess -p /usr/local/etc/goaccess.conf

GoAccess - version 0.9.6 - Oct 27 2015 17:46:33
Config file: /usr/local/etc/goaccess.conf

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

[root@xxxxx home]# goaccess -f /home/syslogaccess_log -p goaccess -p /usr/local/etc/goaccess.conf

GoAccess - version 0.9.6 - Oct 27 2015 17:46:33
Config file: /usr/local/etc/goaccess.conf

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

Any idea?

@allinurl
Copy link
Owner

Interesting... I'm assuming you have uncommented the time/log/date variables in this file /usr/local/etc/goaccess.conf?

Also, running goaccess -f /home/syslogaccess_log -p /usr/local/etc/goaccess.conf should prompt you for a dialog if no time format was specified. Can you please try adding -c to it and select your log format from the given options or enter a custom one. Thanks

@coverguy
Copy link
Author

Hi,

Based on the options table if you notice it, [%d:%t %^] its still showing regardless that i have comment it out and replace another new line with [%d:%^] as per your advise before.

+--------------------------------------------------+
| Log Format Configuration                         |   
| [SPACE] to toggle - [ENTER] to proceed           |   
|                                                  |   
| [x] NCSA Combined Log Format                     |   
| [ ] NCSA Combined Log Format with Virtual Host   |   
| [ ] Common Log Format (CLF)                      |   
| [ ] Common Log Format (CLF) with Virtual Host    |   
| [ ] W3C                                          |   
| [ ] CloudFront (Download Distribution)           |   
|                                                  |   
| Log Format - [c] to add/edit format              |   
| %h %^[%d:%t %^] "%r" %s %b "%R" "%u"" "%u"       |   
|                                                  |   
| Date Format - [d] to add/edit format             |   
| %d/%b/%Y                                         |   
|                                                  |   
| Time Format - [t] to add/edit format             |   
| %H:%M:%S                                         |   
+--------------------------------------------------+

+--------------------------------------------------+
| Log Format Configuration                         |   
| [SPACE] to toggle - [ENTER] to proceed           |   
|                                                  |   
| [ ] NCSA Combined Log Format                     |   
| [x] NCSA Combined Log Format with Virtual Host   |   
| [ ] Common Log Format (CLF)                      |   
| [ ] Common Log Format (CLF) with Virtual Host    |   
| [ ] W3C                                          |   
| [ ] CloudFront (Download Distribution)           |   
|                                                  |   
| Log Format - [c] to add/edit format              |   
| %v:%^ %h %^[%d:%t %^] "%r" %s %b "%R" "%u"       |   
|                                                  |   
| Date Format - [d] to add/edit format             |   
| %d/%b/%Y                                         |   
|                                                  |   
| Time Format - [t] to add/edit format             |   
| %H:%M:%S                                         |   
+--------------------------------------------------+

@allinurl
Copy link
Owner

I think the issue is your log format, you actually need %t. For instance,

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

Can you post a full sample line from your access log.

@coverguy
Copy link
Author

xxxxxx 192.168.x.x - anony [27/Oct/2015:17:49:22 +0800] "GET /mrtg/rtr/guu-SH2-RTR/mrtg-m.png HTTP/1.1" 304 - "http://xxxxx/mrtg/rtr/guu-SH2-RTR/index.html" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0" "SQDATA=d4a2851915464cb9a0514e23f3ba1307" "x.x.x.x" "x.x.x.x" 0

@coverguy
Copy link
Author

Should i add back the log-format with the %t?

@allinurl
Copy link
Owner

The following works with the log line you posted. Please use this in your config file /usr/local/etc/goaccess.conf (make sure to remove the other formats)

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

@coverguy
Copy link
Author

Finally! Its working! hah thanks for your kind assistance and prompt support mate. Aprreciated

@allinurl
Copy link
Owner

Glad that worked :)

Closing this, feel free to reopen this if needed.

@allinurl
Copy link
Owner

You can pipe data into goaccess which gives you a lot of flexibility in terms of what you want to display, so for page views, i.e., html, htm, php, etc.. you can do something like this:

awk '$8~/\.html|\.htm|\.php/' /var/log/apache2/access.log | goaccess

Note, $8 is the request field for your log format above (including NCSA Combined Log Format with Virtual Host), for the common log format, you probably want to use $7 instead. You can always check which field you are shooting for:

tail -10 /var/log/apache2/access.log | awk '{print $8}' 

@coverguy
Copy link
Author

awk '$7~/\.html|\.htm|\.php/' /home/syslogaccess_log | goaccess

@allinurl
Copy link
Owner

From the sample log line above, $7 will give you "GET and not the request /mrtg/rtr/guu-SH2-RTR/mrtg-m.png.

You can check this with awk '{print $7}' or awk '{print $8}'

@coverguy
Copy link
Author

Its print $8 that shows correct output but it doesn't show which IP address visited for each link and i am able to get a unique count using sort but if can grab the IP address would be better :)

@allinurl
Copy link
Owner

From what I understand, issue #117 should address this. It hasn't been implemented yet, though. Stay tuned for this change!

@coverguy
Copy link
Author

Haha, alrighty. Thanks again mate for your kind reply.

@reddykiran449
Copy link

when i am trying to run access log nothing is displayed , Can someone pls help me on this

GoAccess - 0.9.8.
For more details visit: http://goaccess.io
Copyright (C) 2009-2015 GNU GPL'd, by Gerardo Orellana

access_log:

10.171.33.111 - - [14/Apr/2016:05:00:00 -0700] "GET /procurement/adfAuthenticationPreload.gif?r=S6Gb%2F3LGY81EDeuG HTTP/1.1" 302 830 5188 - "-"
10.171.33.111 - - [14/Apr/2016:05:00:00 -0700] "GET /crmCommon/adfAuthenticationPreload.gif?r=S6Gb%2F3LGY81EDeuG HTTP/1.1" 302 848 5024 - "-"
10.177.222.177 - - [14/Apr/2016:05:00:00 -0700] "GET /payables/images/configure_ena.png HTTP/1.1" 200 857 18927 005C72YFjuAAtHQ6ubn3EH0005NG0010tZ "suxxxa.t.n@xxx.com"
10.177.222.177 - - [14/Apr/2016:05:00:00 -0700] "GET /payables/images/openbook_ena.png HTTP/1.1" 200 570 24350 005C72YFjtzAtHQ6ubn3EH0005NG002aUh "subxxxxa.t.n@xxxx.com"

@allinurl
Copy link
Owner

@reddykiran449 could you please explain the fields that you are using on this log?

@reddykiran449
Copy link

reddykiran449 commented Apr 15, 2016

After using below parameters in goacess.conf it is working fine

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

@santoshdj123
Copy link

santosh@laptop:$ goaccess -f access.log >report.html
Segmentation fault (core dumped)
santosh@santosh-laptop:
$ cat /etc/goaccess.conf
log_format %^ %^ %h %^[%d:%^] "%r" %s %b "%R" "%u"
date_format %d/%b/%Y

Still not working. Anything wrong with the conf. also
santosh@laptop:~$ goaccess --dcf
Unknown option `--'.

@allinurl
Copy link
Owner

allinurl commented May 9, 2016

@santoshdj123 It looks like you may be using an old version of goaccess. Which version are you using?

@santoshdj123
Copy link

goaccess version

GoAccess - 0.6

@santoshdj123
Copy link

santoshdj123 commented May 9, 2016

# sudo apt-get upgrade goaccess
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
goaccess is already the newest version.

already newer version.

@allinurl
Copy link
Owner

allinurl commented May 9, 2016

@santoshdj123 Unfortunately the debian/ubuntu repo does not have the latest version of it.

Please use the official deb repo to get the latest stable version.

@santoshdj123
Copy link

santoshdj123 commented May 9, 2016

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

GoAccess - version 0.9.8 - May  9 2016 22:10:14
Config file: /usr/local/etc/goaccess.conf

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

i have latest version but looks like something wrong with log-format . Please suggest

@santoshdj123
Copy link

santoshdj123 commented May 9, 2016

Conf. file.

grep -v "^#" /usr/local/etc/goaccess.conf  | sed '/^$/d' 
log-format %^ %h %^[%d:%t %^] "%r" %s %b "%R" "%u" %^
date-format %d/%b/%Y
time-format %H:%M:%S
config-dialog false
color-scheme 1
hl-header true
no-color false
no-column-names false
no-progress false
with-mouse false
no-csv-summary false
all-static-files false
static-file .css
static-file .js
static-file .jpg
static-file .png
static-file .gif
static-file .ico
static-file .jpeg
static-file .pdf
static-file .txt
static-file .csv
static-file .zip
static-file .mp3
static-file .mp4
static-file .mpeg
static-file .mpg
static-file .exe
static-file .swf
static-file .woff
static-file .woff2
static-file .xls
static-file .xlsx
static-file .doc
static-file .docx
static-file .ppt
static-file .pptx
static-file .iso
static-file .gz
static-file .rar
static-file .svg
static-file .bmp
static-file .tar
static-file .tgz
static-file .tiff
static-file .tif
static-file .ttf
static-file .flv
agent-list false
http-method true
http-protocol true
no-query-string false
no-term-resolver false
real-os true
with-output-resolver false
444-as-404 false
4xx-to-unique-count false
double-decode false
ignore-crawlers false
ignore-panel REFERRERS
ignore-panel KEYPHRASES

@allinurl
Copy link
Owner

allinurl commented May 9, 2016

@santoshdj123 As the message says, you need to add the time-format variable. For instance,

goaccess --log-format='%h %^[%d:%t %^] "%r" %s %b "%R" "%u"' --date-format='%d/%b/%Y' --time-format='%T' -f /var/log/access.log > reports.html

OR uncomment time-format, date-format and log-format under /usr/local/etc/goaccess.conf

@santoshdj123
Copy link

It worked.... thanks a lot.

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

No branches or pull requests

4 participants