Splunk Search

How could I dynamically exclude events from search results?

bpitts2
Path Finder

Hello All,

I'm working on a new query for one of our SIP (VoIP) dashboards. In the SIP world, each call has a unique call ID called the SIP Call ID. Due to the way that our fail-over devices work, we'll see 'phantom' calls on our back-up server because the phones consistently try to register to the backup device.

I'm able to filter the majority of these messages by simply excluding the word "REGISTER" in my current search. However, there are still some false-positive results because of the response messages that are returned by the fail-over device. Both the SIP Call ID and message type are extracted as their own fields.

I would like to build a query that if it finds an event with the message type "REGISTER", it would then exclude all messages with the associated SIP Call IDs.

So far I've managed this:

index=sbc_pci "sipmsg.log" sipmessage="REGISTER" | stats values(call_id) as badcallid | mvexpand badcallid

Which has given me a nice list of the sip call IDs that I want to exclude. I just need some help understanding how I pipe this to a sub search as a "NOT".

Perhaps something like:

index=sbc_pci "sipmsg.log" sipmessage="REGISTER" | stats values(call_id) as badcallid | mvexpand badcallid | search index=sbc_pci "sipmsg.log" NOT badcallid

So close, but I'm not able to connect all the dots.

Thanks!

0 Karma

MuS
Legend

Hi bpitts2,

without knowing too much about your events; try this negative sub search:

your base search here | search NOT [ search index=sbc_pci "sipmsg.log" sipmessage="REGISTER" | stats values(call_id) as badcallid | mvexpand badcallid ]

But be aware of the sub search limits http://docs.splunk.com/Documentation/Splunk/6.3.0/Search/Aboutsubsearches#Subsearch_performance

Hope this helps ...

cheers, MuS

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

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 GA in US-AWS!

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