Splunk Search

Combine similar queries to create summary index

mukeshchandak
Engager

How can I combine these 3 queries given everything before pipe is same:

query1: index=abc source="*/d/e/f.log" artifact_id=g*h*i* host!=“jkl*” cloud=mno consumer_id=* response_code=*|timechart span=1s count

query2: index=abc source="*/d/e/f.log" artifact_id=g*h*i* host!=“jkl*” cloud=mno consumer_id=* response_code=*|timechart span=5m eval(count()) as "Response Code" by response_code

query3: index=abc source="*/d/e/f.log" artifact_id=g*h*i* host!=“jkl*” cloud=mno consumer_id=* response_code=*| timechart span=5m avg(response_time) as "Avg Response Time" p99(response_time) as "99 Percentile" p95(response_time) as "95 Percentile"

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @mukeshchandak,

you could use the append command to put the three searches in one and collect the results in one, but there's the problem that you have different fields.

You could also schedule three different searches and save results in a summary to quicly have results.

But in my opinion, the best solution is to save results of one simple search in a Summary, then running the searches with timechart in three different panels.

In other words, I'd schedule this search, e.g. every 5 minutes:

index=abc source="*/d/e/f.log" artifact_id=g*h*i* host!=“jkl*” cloud=mno consumer_id=* response_code=*
| table _time response_time response_code
| collect index=my_summary

then I'd run the three searches in different dashboard panels:

query1: 
index=my_summary
| timechart span=1s count

query2: 
index=my_summary
| timechart span=5m eval(count()) as "Response Code" by response_code

query3: 
index=my_summary
| timechart span=5m avg(response_time) as "Avg Response Time" p99(response_time) as "99 Percentile" p95(response_time) as "95 Percentile"

Ciao.

Giuseppe

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