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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...