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.38k stars 1.11k forks source link

Summarize different --db-path #2151

Open Bbertatum opened 3 years ago

Bbertatum commented 3 years ago

Hi,

We are using the software to generate the report month-by-month, with --db-path one directory for every month. Like this, it's easy to clean up and the view is clear during the month.

cat ${dirlog}/access_${srvname}.log-${today}.gz | /usr/bin/goaccess - -a -o $DIRSTAT/$srvname/${currentmonth}.html -p $CONFIGFILE --persist --restore --db-path $DIRSTAT/$srvname/${currentmonth}/db But I can't find a way to do a summarize view with every month stored in the db path. I tried something like this :

/usr/bin/goaccess -o /home/stats/www.domain.com/$(date +%Y).html -p /etc/goaccess.conf --restore --db-path="/home/stats/www.domain.com/*/db/" It gave an error on the path: Error occurred at: src/gkhash.c - set_db_path - 1118

Or even with a loop over db-path but the generated .html file is overwritten with the last month:

for path in $(find /home/stats/www.domain.com -type d -name "db");do /usr/bin/goaccess -o /home/stats/www.domain.com/yearly.html -p /etc/goaccess.conf --restore --db-path $path ;done Is there a way to do this or it's just not possible ?

Thanks

0bi-w6n-K3nobi commented 3 years ago

Hi @Bbertatum.

I believe that its not possible. Unfortunately, GoAccess can not restore db from several paths and join them.

I believe it will be necessary build a tool for that.

Bbertatum commented 3 years ago

Thx @0bi-w6n-K3nobi for the answer.

@allinurl could you confirm that is not possible this way ? That means that this question could be transform into a feature-request ?

0bi-w6n-K3nobi commented 3 years ago

Hi @Bbertatum

I can only say from what I know about GoAccess. But what you can confirm is @allinurl.

allinurl commented 3 years ago

@0bi-w6n-K3nobi is correct, there's no way right now to merge the data into one report from multiple db files. It may be worth doing this through an external app that works through the files while creating a new set with the updated numbers. We will have to think a bit more about this though. Thoughs?