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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...