goaccess icon indicating copy to clipboard operation
goaccess copied to clipboard

Summarize different --db-path

Open Bbertatum opened this issue 4 years ago • 4 comments

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

Bbertatum avatar Jul 26 '21 14:07 Bbertatum

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.

0bi-w6n-K3nobi avatar Jul 26 '21 19:07 0bi-w6n-K3nobi

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 ?

Bbertatum avatar Jul 27 '21 10:07 Bbertatum

Hi @Bbertatum

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

0bi-w6n-K3nobi avatar Jul 27 '21 12:07 0bi-w6n-K3nobi

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

allinurl avatar Jul 28 '21 01:07 allinurl