Splunk Search

how to search multiple strings

arunkumardhiman
New Member

Hi Team,

I have a list of 200 filenames (string) that need to be searched in Splunk. Each filename is unique.

example - if I have filenames like 1.txt, 2.txt, 3.txt ........ 200.txt

I am trying it like below -

(1548225008333.4546.-1092053882.Oxalis_jhsediapp02.netsentral.no.doc.xml OR 1126864-1548236892-8712_ehfd.jcloud.no.doc.xml)  |
Tags (1)
0 Karma

vnravikumar
Champion

Hi @arunkumardhiman

Try like

| makeresults 
| eval filename="1.txt" 
| where in(filename,"1.txt","2,txt","3.txt")
0 Karma

arunkumardhiman
New Member

I think I did confuse you.
I have a raw data in Splunk into which I have to first find all the events containing those filenames and then to extract the values from those events only.

0 Karma

vnravikumar
Champion

Here file name is the field in the event

0 Karma

lakshman239
Influencer

You can create a lookup with all the 20 filenames and the use a sub-search - see examples in https://docs.splunk.com/Documentation/Splunk/7.2.3/Search/Aboutsubsearches

Also, within your data, if you have a field that has the filename, pls extract it, as it will come handy when you use sub-search.

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