Splunk Search

help on subsearch field matching

jip31
Motivator

Hi

I use actually the search below in order to doing a match between a search and a workstation name (host)

    eventtype=Charge AND (host=toto OR host=tata OR host=titi)

But I have a huge list of host so I have to find another solution

I tried this but I have no results
eventtype=Charge AND index=”tutu” sourcetype="tete" “$IND$”
“$IND$” is a flag that I can find in host=toto OR host=tata OR host=titi in order to identify these machines
It's strange because when I m just doing index=”tutu” sourcetype="tete" “$IND$”, it returns me the good host list
What is the issue please?

So I planned to do something like this :

eventtype=Charge [|inputlookup host.csv]

OR

eventtype=Charge 
| join host type="outer" 
    [ search index=”tutu” sourcetype="tete" “$IND$”]

What is the best way to do what I want?
Is there other solutions
Thanks for you help

Tags (1)
0 Karma
1 Solution

FrankVl
Ultra Champion

eventtype=Charge AND index=”tutu” sourcetype="tete" “$IND$” is not using a subsearch, you're just adding extra search criteria.

Try: eventtype=Charge [ search index=”tutu” sourcetype="tete" “$IND$”| stats count by host | table host ]

See also: https://docs.splunk.com/Documentation/Splunk/latest/Search/Aboutsubsearches

View solution in original post

0 Karma

FrankVl
Ultra Champion

eventtype=Charge AND index=”tutu” sourcetype="tete" “$IND$” is not using a subsearch, you're just adding extra search criteria.

Try: eventtype=Charge [ search index=”tutu” sourcetype="tete" “$IND$”| stats count by host | table host ]

See also: https://docs.splunk.com/Documentation/Splunk/latest/Search/Aboutsubsearches

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!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...