<?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 Re: Trying to find the 'run time' difference between two daily jobs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126170#M34161</link>
    <description>&lt;P&gt;Thanks again.  This is the query:&lt;BR /&gt;
sourcetype=PROFILE_DAYEND_STATS ClientName = "*"  (UPROC="ZSTRTMAIL" OR UPROC="ZENDMAIL") | eval StartTime=if(UPROC="ZSTRTMAIL",StartTime,null) | eval EndTime=if(UPROC="ZSTRTMAIL",EndTime,null)&lt;BR /&gt;
| eval Start=strptime(StartDate." ".strftime(StartTime,"%H:%M:%S"),"%m/%d/%Y %H:%M:%S") | eval End=strptime(EndDate." ".strftime(EndTime,"%H:%M:%S"),"%m/%d/%Y %H:%M:%S") | transaction startswith="UPROC=ZSTRTMAIL" endswith="UPROC=ZENDMAIL" ClietName | eval TotalDurationSecs=EndTime - StartTime | table ClientName Start End TotalDurationSecs&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 17:00:34 GMT</pubDate>
    <dc:creator>fisuser1</dc:creator>
    <dc:date>2020-09-28T17:00:34Z</dc:date>
    <item>
      <title>Trying to find the 'run time' difference between two daily jobs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126161#M34152</link>
      <description>&lt;P&gt;Hello -&lt;/P&gt;

&lt;P&gt;I am trying to find a way to display the daily run time of a job that kicks off daily.  I am trying to create a display table that shows the start time of the job, the end time of the job and the amount of time the job took to complete daily.&lt;/P&gt;

&lt;P&gt;The start time can be defined by:  ZSTRTMAIL&lt;BR /&gt;
And the end time can be defined by: ZENDMAIL&lt;/P&gt;

&lt;P&gt;I've created the search below, but it does not seem to be calcuting the time differnece between when ZSTRTMAIL starts and ZENDMAIL ends.  Any help would be greatly appreciated.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;event&amp;gt;
  &amp;lt;searchString&amp;gt;sourcetype=DAYEND_STATS $client$ (UPROC="ZSTRTMAIL" OR UPROC="ZENDMAIL") | eval Start=strptime(StartDate." ".StartTime,"%m/%d/%Y %H:%M:%S") | eval End=strptime(EndDate." ".EndTime,"%m/%d/%Y %H:%M:%S") | eval Duration=End-Start | stats sum(Duration) as TotalDurationSecs by ClientName | table ClientName, Start, End, TotalDurationSecs&amp;lt;/searchString&amp;gt;
  &amp;lt;earliestTime&amp;gt;-7d&amp;lt;/earliestTime&amp;gt;
  &amp;lt;latestTime&amp;gt;now&amp;lt;/latestTime&amp;gt;
&amp;lt;/event&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Jul 2014 12:12:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126161#M34152</guid>
      <dc:creator>fisuser1</dc:creator>
      <dc:date>2014-07-01T12:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find the 'run time' difference between two daily jobs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126162#M34153</link>
      <description>&lt;P&gt;Try this search. Note: the field "duration" is auto calculated as part of the transaction command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=DAYEND_STATS $client$ (UPROC="ZSTRTMAIL" OR UPROC="ZENDMAIL") | eval Start=strptime(StartDate." ".StartTime,"%m/%d/%Y %H:%M:%S") | eval End=strptime(EndDate." ".EndTime,"%m/%d/%Y %H:%M:%S") | transaction startswith="UPROC=ZSTRTMAIL" endswith="UPROC=ZENDMAiL" maxspan=8h ClientName | stats sum(duration) as TotalDurationSecs by ClientName | table ClientName, Start, End, TotalDurationSecs
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Jul 2014 12:21:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126162#M34153</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2014-07-01T12:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find the 'run time' difference between two daily jobs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126163#M34154</link>
      <description>&lt;P&gt;Can you provide some sample logs? Its a pretty regulation requirement and sample can help get you closest answer.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2014 13:15:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126163#M34154</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-07-01T13:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find the 'run time' difference between two daily jobs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126164#M34155</link>
      <description>&lt;P&gt;Sure...&lt;/P&gt;

&lt;P&gt;Detail Data consists of    Company|Start Date|Start Time|End Date|End Time|Session|UPROC&lt;/P&gt;

&lt;P&gt;PP1800|07/07/2014|1404707403000|07/07/2014|1404707404000|1800DEOD|ZSTRTMAIL&lt;BR /&gt;
PP1800|07/07/2014|1404717862000|07/07/2014|1404717863000|1800DDDP|ZENDMAIL&lt;BR /&gt;
PP3500|07/07/2014|1404705805000|07/07/2014|1404705806000|3500DEOD|ZSTRTMAIL&lt;BR /&gt;
PP3500|07/07/2014|1404706391000|07/07/2014|1404706393000|3500DDDP|ZENDMAIL&lt;BR /&gt;
PP7700|07/06/2014|1404704440000|07/06/2014|1404704443000|7700DEOD|ZSTRTMAIL&lt;BR /&gt;
PP7700|07/07/2014|1404713856000|07/07/2014|1404713861000|7700DDDP|ZENDMAIL&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jul 2014 15:17:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126164#M34155</guid>
      <dc:creator>fisuser1</dc:creator>
      <dc:date>2014-07-07T15:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find the 'run time' difference between two daily jobs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126165#M34156</link>
      <description>&lt;P&gt;Try this (please validate the field names as the fields in your logs and your query in the question seems to be different)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=DAYEND_STATS $client$ (UPROC="ZSTRTMAIL" OR UPROC="ZENDMAIL") | eval StartTime=if(UPROC="ZSTRTMAIL",StartTime,null) | eval EndTime=if(UPROC="ZSTRTMAIL",EndTime,null)
| eval Start=StartDate." ".strftime(StartTime,"%H:%M:%S") 
| eval End=EndDate." ".strftime(EndTime,"%H:%M:%S") 
| transaction startswith="UPROC=ZSTRTMAIL" endswith="UPROC=ZENDMAIL" Company | eval TotalDurationSecs=EndTime - StartTime | table Company Start End TotalDurationSecs
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Jul 2014 15:53:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126165#M34156</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-07-07T15:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find the 'run time' difference between two daily jobs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126166#M34157</link>
      <description>&lt;P&gt;Thank you!  This looks MUCH better!  I am seeing inaccurate years populated in the table, any suggestions?&lt;/P&gt;

&lt;P&gt;ClientName  Start   End TotalDurationSecs&lt;BR /&gt;
    01/08/1978 03:46:48  01/08/1978 04:03:28     1000&lt;BR /&gt;
    12/20/1977 15:53:28  12/20/1977 16:10:08     1000&lt;BR /&gt;
    12/04/1977 20:43:28  12/04/1977 21:33:28     3000&lt;BR /&gt;
    11/30/1977 07:16:48  11/30/1977 07:50:08     2000&lt;BR /&gt;
    11/17/1977 17:03:28  11/17/1977 17:20:08     1000&lt;BR /&gt;
    11/11/1977 23:16:48  11/11/1977 23:33:28     1000&lt;BR /&gt;
    11/06/1977 23:50:08  11/07/1977 01:13:28     5000&lt;BR /&gt;
    10/17/1977 00:06:48  10/17/1977 00:23:28     1000&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jul 2014 18:16:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126166#M34157</guid>
      <dc:creator>fisuser1</dc:creator>
      <dc:date>2014-07-07T18:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find the 'run time' difference between two daily jobs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126167#M34158</link>
      <description>&lt;P&gt;Try the updated answer.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jul 2014 18:32:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126167#M34158</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-07-07T18:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find the 'run time' difference between two daily jobs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126168#M34159</link>
      <description>&lt;P&gt;This is what it displays in the Events running the command.&lt;/P&gt;

&lt;P&gt;PP1800|07/07/2014|1404707403000|07/07/2014|1404707404000|1800DEOD|ZSTRTMAIL&lt;BR /&gt;
PP1800|07/07/2014|1404717862000|07/07/2014|1404717863000|1800DDDP|ZENDMAIL&lt;BR /&gt;
PP3500|07/07/2014|1404705805000|07/07/2014|1404705806000|3500DEOD|ZSTRTMAIL&lt;BR /&gt;
PP3500|07/07/2014|1404706391000|07/07/2014|1404706393000|3500DDDP|ZENDMAIL&lt;BR /&gt;
PP7700|07/06/2014|1404704440000|07/06/2014|1404704443000|7700DEOD|ZSTRTMAIL&lt;BR /&gt;
PP7700|07/07/2014|1404713856000|07/07/2014|1404713861000|7700DDDP|ZENDMAIL&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jul 2014 19:20:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126168#M34159</guid>
      <dc:creator>fisuser1</dc:creator>
      <dc:date>2014-07-07T19:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find the 'run time' difference between two daily jobs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126169#M34160</link>
      <description>&lt;P&gt;can you share the query that you're running? The output should be in table format from the query that I suggested.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jul 2014 19:48:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126169#M34160</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-07-07T19:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find the 'run time' difference between two daily jobs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126170#M34161</link>
      <description>&lt;P&gt;Thanks again.  This is the query:&lt;BR /&gt;
sourcetype=PROFILE_DAYEND_STATS ClientName = "*"  (UPROC="ZSTRTMAIL" OR UPROC="ZENDMAIL") | eval StartTime=if(UPROC="ZSTRTMAIL",StartTime,null) | eval EndTime=if(UPROC="ZSTRTMAIL",EndTime,null)&lt;BR /&gt;
| eval Start=strptime(StartDate." ".strftime(StartTime,"%H:%M:%S"),"%m/%d/%Y %H:%M:%S") | eval End=strptime(EndDate." ".strftime(EndTime,"%H:%M:%S"),"%m/%d/%Y %H:%M:%S") | transaction startswith="UPROC=ZSTRTMAIL" endswith="UPROC=ZENDMAIL" ClietName | eval TotalDurationSecs=EndTime - StartTime | table ClientName Start End TotalDurationSecs&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:00:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126170#M34161</guid>
      <dc:creator>fisuser1</dc:creator>
      <dc:date>2020-09-28T17:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find the 'run time' difference between two daily jobs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126171#M34162</link>
      <description>&lt;P&gt;And this is the output of said query:&lt;/P&gt;

&lt;P&gt;Start                End              TotalDurationSecs &lt;BR /&gt;
1404719208.000000    1404720208.000000   1000&lt;BR /&gt;
1404762808.000000    1404763808.000000   1000&lt;BR /&gt;
1404693808.000000    1404696808.000000   3000&lt;BR /&gt;
1404645408.000000    1404647408.000000   2000&lt;BR /&gt;
1404680608.000000    1404681608.000000   1000&lt;BR /&gt;
1404703008.000000    1404704008.000000   1000&lt;BR /&gt;
1404705008.000000    1404623608.000000   5000&lt;BR /&gt;
1404619608.000000    1404620608.000000   1000&lt;BR /&gt;
1404655008.000000    1404656008.000000   1000&lt;BR /&gt;
1404668408.000000    1404669408.000000   1000&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jul 2014 21:02:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126171#M34162</guid>
      <dc:creator>fisuser1</dc:creator>
      <dc:date>2014-07-07T21:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find the 'run time' difference between two daily jobs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126172#M34163</link>
      <description>&lt;P&gt;My bad. Try the updated answer. This should take care of formatting of Start and End.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jul 2014 21:06:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126172#M34163</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-07-07T21:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to find the 'run time' difference between two daily jobs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126173#M34164</link>
      <description>&lt;P&gt;That worked perfectly!  Thank you somesoni2!!!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jul 2014 21:19:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-find-the-run-time-difference-between-two-daily-jobs/m-p/126173#M34164</guid>
      <dc:creator>fisuser1</dc:creator>
      <dc:date>2014-07-07T21:19:04Z</dc:date>
    </item>
  </channel>
</rss>

