Splunk Search

How can I find results only iff the previous queries returns results?

yk010123
Path Finder

I calculate the requests per second for my application using the following query: 

 

 

method!=GET process="start"
| timechart count by region limit=0
| timechart per_second(*)

 

I also calculate the number of errors my application is producing using the following separate query

 

 

process=end AND status=500
| timechart count
| timechart per_second(*)

 

 

I am trying to find a query that will answer when my application "breaks", or in other words, what is the requests per second that causes my application to have more than N errors

 

 

Labels (3)
0 Karma

yeahnah
Motivator

Hi @yk010123 

It usually easier to help when there are some example events provided, but based on what you've shown in the SPL something like this should work

(method!=GET process="start") OR (process=end AND status=500)
| eval region=coalesce(region, "none") ``` account for end event not having a region ```
      ,type=if(process="start", "start", "end")
| stats count BY _time type region
| timechart span=1m
    sum(eval(type="start")) AS start
    sum(eval(type="end")) AS end
  BY region
| timechart per_second(*)

One query that combines the results into one table/graph.

Hope it 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!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...