Splunk Search

How to edit my search to filter out results where the HTTP Referrer contains a Blank or a Dash?

saqibhome
Explorer

I have a search as follows:

(Referrer!="*bing*" AND Referrer!="*google*")

Note: Referrer is the http_referrer field from Apache Logs.

The above includes log entries that have the Referrer as blank and also the one that have a - (dash)

How can I filter out the entries that have dash and blanks as well? I tried the following but it didn't do the trick:

(Referrer!="*bing*" AND Referrer!="*google*" AND Referrer!="\\-" AND Referrer="*")

Please advise

0 Karma

woodcock
Esteemed Legend

Like this:

 (Referrer!="*bing*" AND Referrer!="*google*" | where NOT like(Referrer,"%-%") AND NOT like(Referrer,"%*%")
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Have you tried this?

(Referrer!="*bing*" AND Referrer!="*google*" AND Referrer!="-" AND Referrer!="")
---
If this reply helps you, Karma would be appreciated.
0 Karma

saqibhome
Explorer

Yes, that doesn't filter out entries where the Referrer is set to - (dash)

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...