Splunk Enterprise

Find failed job reason

tmontney
Builder

I want to see any failed job, ad-hoc and scheduled. For instance, I was creating a new search command, and it failed a lot until I got it right. I expect to see the same error, I see in web search, in the logs:

  • | rest /servicesNS/-/-/search/jobs shows a handful over 4 hours. There was far more than that.
  • _audit shows plenty of failed searches, but not the reason
  • _internal doesn't show anything useful
Labels (1)
0 Karma

codebuilder
Influencer

Use the Job Inspector.

https://docs.splunk.com/Documentation/Splunk/8.2.1/Search/ViewsearchjobpropertieswiththeJobInspector

----
An upvote would be appreciated and Accept Solution if it helps!
0 Karma

tmontney
Builder

After posting, I ended up with this:

| rest /servicesNS/-/-/search/jobs
| eval t=strptime(updated, "%Y-%m-%dT%H:%M:%S.%f-%z")
| where 
    [ makeresults 
    | addinfo
    | eval search=" t >= ". info_min_time. if(info_max_time=="+Infinity",""," AND t <= ".info_max_time) ]
| eval hadError=case(isFailed=1, 1, isNotNull('messages.error'), 1, 1=1, 0)
| search hadError=1
| stats count
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 ...