Splunk Search

How to use the INPUTLOOKUP command on Splunk Cloud

paksan32
New Member

Hi Everyone,
So we are using SPlunk Cloud and I have created a dashboard that searches for the top 100 most reoccurring messages coming in from out servers. After sifting through this list we pretty much eliminated about 70 of them as none important. Im having trouble with excluding these 70 common errors. I made a query that has a bunch of NOT statements but this isnt practical. I stumbled upon the inputlookup command and uploaded a .csv file that includes the 70 messages we dont care about. However, my search still doesn't seem to look at anything in the csv file. Does anyone have an suggestions?

My search string is:
index=* | inputlookup append=true exludedeerrors.csv | fields message | stats count by Message host index source | sort - count top limit=10

Tags (1)
0 Karma

woodcock
Esteemed Legend

Like this:

index=* NOT [| inputlookup exludedeerrors.csv | table message | rename message AS Message]
| stats count by Message host index source
| sort - count top limit=10
0 Karma

bandit
Motivator

Possibly you were trying to do a subsearch for the exclusions? BTW you'll also want to specify an index or indexes for better performance if possible.
https://docs.splunk.com/Documentation/Splunk/latest/Search/Usesubsearchtocorrelateevents

index=* NOT [ |inputlookup exludedeerrors.csv | return 1000 message ] 
| top message by host index source 
0 Karma

bandit
Motivator

I've noticed the case for message is consistent - one part of your query has "message" and another part has "Message". Is this intentded? Field names are case sensitive in Splunk

0 Karma

bandit
Motivator

You can use one or more macros for your exclude list. You can also use the macros in multiple queries and just update the macro when your exclude list changes.
https://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Usesearchmacros

Also take a look at the ** IN ** command

instead of

NOT message="this" NOT message="that" NOT message="those"

try

NOT message IN ("this","that","those")
0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...