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

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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...