Splunk Search

Negate the field containing both the values in SPLUNK query

Janani_Krish
Path Finder

Hi,

I have written following query where a field consisting of 2 actions as below,

Query:
sourcetype="my_sourcetype" session_id="1011" |eval indicator=mvappend(src,dest)|mvexpand indicator|stats count values(action) by indicator,session_id

Result:

indicatorsession_idcountvalue(action)
23.45.6.7810112allowed
teared
23.45.6.7910452allowed

 

Now I want to negate the field which contain both allowed and teared. Please suggest any ideas.

Labels (1)
Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Like this, maybe?

sourcetype="my_sourcetype" session_id="1011" 
| eval indicator=mvappend(src,dest)
| mvexpand indicator
| stats count values(action) as actions by indicator,session_id
| where (isnull(mvfind(actions,"allowed")) AND isnull(mvfind(actions,"teared")))
---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Why You Can't Miss .conf25: Unleashing the Power of Agentic AI with Splunk & Cisco

The Defining Technology Movement of Our Lifetime The advent of agentic AI is arguably the defining technology ...

Deep Dive into Federated Analytics: Unlocking the Full Power of Your Security Data

In today’s complex digital landscape, security teams face increasing pressure to protect sprawling data across ...

Your summer travels continue with new course releases

Summer in the Northern hemisphere is in full swing, and is often a time to travel and explore. If your summer ...