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!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...