Splunk Search

multiple searches in multiple sourcetypes resulting in a single chart

sailey
New Member

Below are the few patterns that I wanted to search from multiple sourcetypes and get the count. I have around 50 patterns.
Is the only way to write OR in between each search and get the counts in a single chart or is there any other better way.

Login status is
Account details flow for Apple Phone for user Id XXXXXX
Payment status and XXXXX YYYYYYY
Account details flow for Android Phone for user Id XXXXXX
finger print status of User id YYYYY
Transfer account status ZZZZZZ AAAAAA

Tags (1)
0 Karma

gokadroid
Motivator

I am not sure how befitting it is in your scenario but if Idea is just to avoid writing OR(s) between 50 patterns to search then can you try this:

1) Make a csv file of all your pattern and upload it as a lookup say patterns.csv which has fieldname (say) PatternField

PatternField
Login status is
Account details flow for Apple Phone for user Id
Payment status and
Account details flow for Android Phone for user Id
finger print status of User id
Transfer account status

After that use the below query to complete your search by replacing your sourcetype names for "A", "B", "C" and so on:

sourcetype=A OR sourcetype=B OR sourcetype=C ([|inputlookup patterns.csv | fields PatternField | return 50 $PatternField ] )

Hope this helps.

0 Karma
Get Updates on the Splunk Community!

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

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...