Splunk Search

Search with like / only when more than one value

banzen
Engager

Hi,
I have troubles with a search. I want results ONLY when my "disconnected=" has a value besides blov6 berg

Unfiltered result:
Disconnected="[blov6 berg ] [dj7 berger]",

I would want to know about this..

Could look like this too

Disconnected="[blov6 berg ] [ejb7 rger] [rf34 reef]", 
Disconnected="[blov6 berg ] [dj7 berger] [l42 loop][ddd door]"

Would also want to know....

This I don't care about

Disconnected="[blov6 berg ]"

Here's what I am trying in my search

host=*  Disconnected | where disconnected !=""  | where NOT like(_raw, "%blov6%")

Suggestions?

Tags (1)
0 Karma

micahkemp
Champion

Try something like:

 host=* Disconnected Disconnected!="[blov6 berg ]"

Edit: do you need a partial match to be ignored as well?

Try this:

| rex field=Disconnected max_match=0 "\[(?<bracketed_value>[^\]]+)\]"
| search NOT bracketed_value="blov6 berg "
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[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 ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...