Goaccess: Add ability to hide referrers from report (e.g., local sites).

Created on 20 May 2017  路  4Comments  路  Source: allinurl/goaccess

I've got 80...90% local referrers within a website.

With
goaccess my.log -a -o report.html
I get a nice report including all requests. But in the referrer urls and referrer sites reports, I only find referrers within the same website, as there are so many. Works as intended.

The report including the local referrers is correct, but not nice - I'd like to see only the interesting referrers directing from external websites to the local site.
So I try a
goaccess my.log -a --ignore-referer=www.example.com --ignore-referer=example.com -o report.html
and get nice referrer urls and referrer sites reports without the local site referrers.
Only problem: the ignore-referer option makes goaccess completely ignore the log lines containing these referrers (correctly behaviour as described in the .conf file: "Ignore referers from being counted"), resulting in a report that is missing many hits.

An additional or changed option would be nice: counting the loglines as hits, but ignoring their referrer information

add change log-processing

All 4 comments

Quick and dirty patch to add an option for that... I tested it only making a html report, hope it is not too dirty :-)
It will ignore the "-" referrers for the referrer url report as well.
Added "--ignore-referer-report=..." option to exclude the matching referrer lines from the referrer url and referrer site report, but still count these loglines as hits.
Usage example:
goaccess my.log -a --ignore-referer-report=www.example.com --ignore-referer-report=example.com -o report.html

changes_add_option_ignore-referer-report.patch.txt

Thanks for sending this in. I can certainly apply the patch. Though, I'm still wondering if perhaps using a shorter command line option is the way to go. e.g., --hide-referer vs --ignore-referer, where the former would not display the stats and the latter won't even count the stats. Thoughts?

That sounds great, an option name like "--hide-referer" would be more distinguishable from the "--ignore-*" options and would it would be exactly what the option is about: hiding some lines in a subreport, not excluding them from the overall sum.

This has been updated. Added --hide-referer command line option to hide referers from report.

This also allows the ability to use wild cards. For instance,

'*' matches 0 or more characters (including spaces)
'?' matches exactly one character
hide-referer *.domain.com
hide-referer ww?.domain.*

Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

canepa picture canepa  路  3Comments

LoanDEV picture LoanDEV  路  3Comments

vivekkrish picture vivekkrish  路  3Comments

ychunc picture ychunc  路  3Comments

konungrl picture konungrl  路  3Comments