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
Get Updates on the Splunk Community!

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...