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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...