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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...