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