Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to hide referrers from report (e.g., local sites). #778

Closed
neftha opened this issue May 20, 2017 · 4 comments
Closed

Add ability to hide referrers from report (e.g., local sites). #778

neftha opened this issue May 20, 2017 · 4 comments

Comments

@neftha
Copy link

neftha commented May 20, 2017

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

@neftha
Copy link
Author

neftha commented May 20, 2017

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

@allinurl
Copy link
Owner

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?

@neftha
Copy link
Author

neftha commented May 22, 2017

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.

@allinurl allinurl changed the title Referrers: ignore option for local referrers Referrers: hide option for local referrers May 24, 2017
@allinurl allinurl changed the title Referrers: hide option for local referrers Add ability to hide referrers from report (e.g., local sites). Jun 6, 2017
@allinurl
Copy link
Owner

allinurl commented Jun 6, 2017

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

@allinurl allinurl closed this as completed Jun 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants