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.
https://goaccess.io
MIT License
18.12k stars 1.1k forks source link

Can't read config-file despite it existing. #2064

Closed Ge0rges closed 3 years ago

Ge0rges commented 3 years ago

Hello all.

I'm trying to set my global configuration file to /etc/goaccess/goaccess.conf. For some reason go access -p /etc/goaccess/goaccess.conf simply returns the help text, and using --config-file= returns that the file doesn't exist (it does). Here's terminal output.

root:~# goaccess -p --config-file=/etc/goaccess/goaccess.conf 

GoAccess - version 1.3 - Nov 15 2019 14:44:43
Config file: --config-file=/etc/goaccess/goaccess.conf

Fatal error has occurred
Error occurred at: src/settings.c - get_config_file_path - 129
Unable to open the specified config file. No such file or directory

root:~# ls -la /etc/goaccess/goaccess.conf 
-rw-r--r-- 1 root root 21124 Mar 26 10:20 /etc/goaccess/goaccess.conf
root:~# sudo goaccess -p --config-file=/etc/goaccess/goaccess.conf 

GoAccess - version 1.3 - Nov 15 2019 14:44:43
Config file: --config-file=/etc/goaccess/goaccess.conf

Fatal error has occurred
Error occurred at: src/settings.c - get_config_file_path - 129
Unable to open the specified config file. No such file or directory

root:~# sudo goaccess -p /etc/goaccess/goaccess.conf 

GoAccess - 1.3
(help text)
allinurl commented 3 years ago

Could you please try with the latest version?

Ge0rges commented 3 years ago

Now getting

root:~# goaccess -p /etc/goaccess/goaccess.conf
Config file: /etc/goaccess/goaccess.conf
GoAccess - version 1.4.6 - Mar  1 2021 03:28:28

Fatal error has occurred
Error occurred at: src/goaccess.c - initializer - 1385
No input data was provided nor there's data to restore.
allinurl commented 3 years ago

You have to specify a log to parse. You can add it to the command line or to your /etc/goaccess/goaccess.conf. e.g.,

root:~# goaccess /path/to/access.log -p /etc/goaccess/goaccess.conf
Ge0rges commented 3 years ago

Got it, thought that was just setting the global config file. thanks!