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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...