<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to create a scheduled job time to find the run time of each of the searches? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-scheduled-job-time-to-find-the-run-time-of-each/m-p/454236#M128520</link>
    <description>&lt;P&gt;I'm working w/ a similar issue as: &lt;A href="https://answers.splunk.com/answers/512103/how-to-get-a-list-of-schedules-searches-reports-al.html"&gt;https://answers.splunk.com/answers/512103/how-to-get-a-list-of-schedules-searches-reports-al.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The addendum to that is I want to find the run time of each of the searches. I'm thinking perhaps there are too many searches running at the same time and is causing Splunk inner-connectivity issues.&lt;/P&gt;

&lt;P&gt;It would be really nice to have a scheduled job time and the amount of time it took to run the last time (or several times).&lt;/P&gt;</description>
    <pubDate>Tue, 11 Sep 2018 15:26:08 GMT</pubDate>
    <dc:creator>moorvogi</dc:creator>
    <dc:date>2018-09-11T15:26:08Z</dc:date>
    <item>
      <title>How to create a scheduled job time to find the run time of each of the searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-scheduled-job-time-to-find-the-run-time-of-each/m-p/454236#M128520</link>
      <description>&lt;P&gt;I'm working w/ a similar issue as: &lt;A href="https://answers.splunk.com/answers/512103/how-to-get-a-list-of-schedules-searches-reports-al.html"&gt;https://answers.splunk.com/answers/512103/how-to-get-a-list-of-schedules-searches-reports-al.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The addendum to that is I want to find the run time of each of the searches. I'm thinking perhaps there are too many searches running at the same time and is causing Splunk inner-connectivity issues.&lt;/P&gt;

&lt;P&gt;It would be really nice to have a scheduled job time and the amount of time it took to run the last time (or several times).&lt;/P&gt;</description>
      <pubDate>Tue, 11 Sep 2018 15:26:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-scheduled-job-time-to-find-the-run-time-of-each/m-p/454236#M128520</guid>
      <dc:creator>moorvogi</dc:creator>
      <dc:date>2018-09-11T15:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a scheduled job time to find the run time of each of the searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-scheduled-job-time-to-find-the-run-time-of-each/m-p/454237#M128521</link>
      <description>&lt;P&gt;If you are trying to troubleshoot scheduled search concurrency why not use the monitoring console? check "Search &amp;gt;&amp;gt; Scheduler Activity: Instance". You can get alot of information there (inc. the average runtime for the searches).&lt;/P&gt;</description>
      <pubDate>Tue, 11 Sep 2018 16:43:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-scheduled-job-time-to-find-the-run-time-of-each/m-p/454237#M128521</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2018-09-11T16:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a scheduled job time to find the run time of each of the searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-scheduled-job-time-to-find-the-run-time-of-each/m-p/454238#M128522</link>
      <description>&lt;P&gt;In that question, they look at the rest api. However, timings can be found in index=_audit. Depending on what your exact criteria is, you may want to join two searches. Below I demonstrate the timings are in _audit:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_audit savedsearch_name=* savedsearch_name!="" timestamp=* total_run_time=*
| eval temp=strptime(total_run_time,"%Y%m%d%H%M%S") 
| convert timeformat="%m-%d-%Y %H:%M:%S" ctime(temp)
| table timestamp total_run_time savedsearch_name
| sort - timestamp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For more information, this was cobbled together from:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/507790/index-audit-contents.html"&gt;https://answers.splunk.com/answers/507790/index-audit-contents.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/39402/convert-timeformat.html"&gt;https://answers.splunk.com/answers/39402/convert-timeformat.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Sep 2018 16:46:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-scheduled-job-time-to-find-the-run-time-of-each/m-p/454238#M128522</guid>
      <dc:creator>efavreau</dc:creator>
      <dc:date>2018-09-11T16:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a scheduled job time to find the run time of each of the searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-scheduled-job-time-to-find-the-run-time-of-each/m-p/454239#M128523</link>
      <description>&lt;P&gt;I'll double check but i don't think it has the info i'm looking for. In short, we're seeing connection issues at waht appears to be random times/intervals. Knowing "nothing is random" there's a pattern somewhere so "average" isn't going to give me the info i think i need. HAHAH notice i said think i need, not sure it'll answer what i'm looking for.&lt;/P&gt;

&lt;P&gt;Other answers posts indicate that it's likely due to a query timeout in the configs. We've more than doubled the default timeouts but i'm still thinking it's bottle-necked somewhere. We can run the same query that times out a couple minutes later and it's fine.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Sep 2018 16:57:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-scheduled-job-time-to-find-the-run-time-of-each/m-p/454239#M128523</guid>
      <dc:creator>moorvogi</dc:creator>
      <dc:date>2018-09-11T16:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a scheduled job time to find the run time of each of the searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-scheduled-job-time-to-find-the-run-time-of-each/m-p/454240#M128524</link>
      <description>&lt;P&gt;i'll take this answer as it's exactly what i was looking for! I do have a follow up though, what is the "total run time" value if it's "*" in the resultset? &lt;/P&gt;

&lt;P&gt;example: i assume records show run time in seconds and they are 5, 6, 15, 400 and *  what's the value of "*"  in the output result set?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Sep 2018 17:08:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-scheduled-job-time-to-find-the-run-time-of-each/m-p/454240#M128524</guid>
      <dc:creator>moorvogi</dc:creator>
      <dc:date>2018-09-11T17:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a scheduled job time to find the run time of each of the searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-scheduled-job-time-to-find-the-run-time-of-each/m-p/454241#M128525</link>
      <description>&lt;P&gt;Good morning,&lt;/P&gt;

&lt;P&gt;I think this SPL does what you're asking to do. It's similar to searches built into the monitoring console but more specifically tailored to your requirements.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=_internal sourcetype=scheduler &lt;BR /&gt;
| stats values(app) AS splunk_app, values(scheduled_time) AS scheduled_time, values(dispatch_time) AS dispatch_time, values(result_count) AS result_count, values(search_type) AS search_type, values(status) AS status, values(run_time) AS run_time&lt;BR /&gt;
    by sid &lt;BR /&gt;
| convert ctime(scheduled_time) AS scheduled_time_pretty, ctime(dispatch_time) AS dispatch_time_pretty &lt;BR /&gt;
| eval schedule_dispatch_delta = dispatch_time-scheduled_time, schedule_dispatch_delta_pretty = tostring(schedule_dispatch_delta,"duration")&lt;BR /&gt;
| table sid, splunk_app,status,search_type,result_count,run_time,scheduled_time_pretty,dispatch_time_pretty,schedule_dispatch_delta_pretty&lt;BR /&gt;
| sort - run_time&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This search uses the &lt;STRONG&gt;_internal&lt;/STRONG&gt; index and the &lt;STRONG&gt;scheduled&lt;/STRONG&gt; sourcetype to pull meta information about your scheduled searches. It specifically focuses on scheduling and run-time of the searches and works to identify searches that are struggling.&lt;/P&gt;

&lt;P&gt;I recommend using this as a starting place then investigating further by adding &lt;STRONG&gt;|stats count by FIELDNAME&lt;/STRONG&gt; based on fields you want to investigate. For example, adding &lt;STRONG&gt;|stats count by scheduled_time_pretty&lt;/STRONG&gt; will give you a count of searches based on the times they are scheduled to run. That can help you identify if you have too many searches scheduled at the same time.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:10:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-scheduled-job-time-to-find-the-run-time-of-each/m-p/454241#M128525</guid>
      <dc:creator>zonistj</dc:creator>
      <dc:date>2020-09-29T21:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a scheduled job time to find the run time of each of the searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-scheduled-job-time-to-find-the-run-time-of-each/m-p/454242#M128526</link>
      <description>&lt;P&gt;The * is to say we want something in there - not null. The details I found on total_run_time were for the &lt;CODE&gt;history&lt;/CODE&gt; command: "The total time it took to run the search in seconds." Source: &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.2/SearchReference/History" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.2/SearchReference/History&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:13:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-scheduled-job-time-to-find-the-run-time-of-each/m-p/454242#M128526</guid>
      <dc:creator>efavreau</dc:creator>
      <dc:date>2020-09-29T21:13:29Z</dc:date>
    </item>
  </channel>
</rss>

