Splunk Search

How to exclude two event types when together?

yoshileigh66
Explorer

I have noticed that the event_ids that I cannot find documentation for are associated with two eventtypes together. However,  individually, those eventtypes are also associated with other event_ids. 

How do I exclude the two eventtypes from the search only when they are both associated with an event_id? 

I tried eventtype != "xxx" AND eventtype!="yyy" but that doesn't group both of the eventtypes together, if that makes sense. So each event_id associated with "xxx" is excluded from the search, which is not the result I need. 

0 Karma

woodcock
Esteemed Legend

This is a basic boolean logic error.  Try this:

... NOT (eventtype="xxx" AND eventtype="yyy")

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Is eventtype a multivalue field in your events? If not, you can make it so (before applying @woodcock 's logic)

| eventstats values(eventtype) as eventtypes by event_id
| where NOT (eventtypes=="xxx" AND eventtypes=="yyy")

Note that the collection of eventtypes are put in a new field so that the original eventtype for the event is preserved

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...