<?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: Extract execution time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-execution-time/m-p/670473#M229840</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233874"&gt;@marco_carolo&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you should extract all the fields and then correlate them:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| rex "[^\[]*\[(?&amp;lt;extracted_pid&amp;gt;[^\]]*)\]\s*\[(?&amp;lt;extracted_job_name&amp;gt;[^\]]*)\]\s*\[(?&amp;lt;extracted_index&amp;gt;[^\]]+\]\s*)(?&amp;lt;msg&amp;gt;.*)"
| stats 
   earliest(_time) AS earliest
   latest(_time) AS latest
   BY talend_job_name
| eval 
   duration=latest-earliest, 
   earliest=strftime(earliest,"%Y-%m-%d %H:%M:%S"),   
   latest=strftime(latest,"%Y-%m-%d %H:%M:%S")
| table talend_job_name earliest latest duration&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 01 Dec 2023 15:35:37 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-12-01T15:35:37Z</dc:date>
    <item>
      <title>Extract execution time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-execution-time/m-p/670471#M229839</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've the following situation:&lt;/P&gt;&lt;P&gt;I've inside logs the ETL logs, I've already extracted some data via search fields.&lt;/P&gt;&lt;P&gt;The log structure is the following:&lt;/P&gt;&lt;P&gt;Fri Dec 1 16:00:59 2023 [extracted_pid] [extracted_job_name] [extracted_index_operation_incremental] extracted_message&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;Fri Dec 1 07:57:40 2023 [111111][talend_job_name] [100] End job&lt;/P&gt;&lt;P&gt;Fri Dec 1 06:50:40 2023 [111111][talend_job_name] [70] Start job&lt;/P&gt;&lt;P&gt;Fri Dec 1 06:50:39 2023 [111111][talend_job_name1] [69] End job&lt;/P&gt;&lt;P&gt;Fri Dec 1 05:40:40 2023 [111111][talend_job_name1] [30] Start job&lt;/P&gt;&lt;P&gt;Fri Dec 1 05:40:39 2023 [111111][talend_job_name2] [29] End job&lt;/P&gt;&lt;P&gt;Fri Dec 1 02:50:40 2023 [111111][talend_job_name2] [1] Start job&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected:&lt;/P&gt;&lt;P&gt;PID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NAME&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EXEC_TIME&lt;/P&gt;&lt;P&gt;111111 talend_job_name 1h 7min&lt;/P&gt;&lt;P&gt;111111 talend_job_name1 1h 10min&lt;/P&gt;&lt;P&gt;111111 talend_job_name2 2h 50min&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I was requested to do is to extract a table containing the job name and the execution time, one for each pid (a job can be executed multiple times, but each time has a different PID) in order to have the data available.&lt;/P&gt;&lt;P&gt;It is not necessary that the job starts with index 1, since all subjobs inside a job have a separated logged name (for example, the import all could contain 10 subjobs, each of one with different names)&lt;/P&gt;&lt;P&gt;My idea of a query would be a query that involves the PID and the job name combined as primary key, considering the start time the lower&amp;nbsp;extracted_index_operation_incremental for that specific PK and the end time the max value of&amp;nbsp;extracted_index_operation_incremental for that PK.&lt;/P&gt;&lt;P&gt;Any help? &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 15:22:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-execution-time/m-p/670471#M229839</guid>
      <dc:creator>marco_carolo</dc:creator>
      <dc:date>2023-12-01T15:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: Extract execution time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-execution-time/m-p/670473#M229840</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233874"&gt;@marco_carolo&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you should extract all the fields and then correlate them:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| rex "[^\[]*\[(?&amp;lt;extracted_pid&amp;gt;[^\]]*)\]\s*\[(?&amp;lt;extracted_job_name&amp;gt;[^\]]*)\]\s*\[(?&amp;lt;extracted_index&amp;gt;[^\]]+\]\s*)(?&amp;lt;msg&amp;gt;.*)"
| stats 
   earliest(_time) AS earliest
   latest(_time) AS latest
   BY talend_job_name
| eval 
   duration=latest-earliest, 
   earliest=strftime(earliest,"%Y-%m-%d %H:%M:%S"),   
   latest=strftime(latest,"%Y-%m-%d %H:%M:%S")
| table talend_job_name earliest latest duration&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 15:35:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-execution-time/m-p/670473#M229840</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-12-01T15:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Extract execution time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-execution-time/m-p/670600#M229872</link>
      <description>&lt;P class="lia-align-left"&gt;Thanks a lot,&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;a bonus question for&amp;nbsp; a bonus karma point...&lt;/P&gt;&lt;P class="lia-align-left"&gt;I want to create a stacked column chart with for each job name the distinct values fo duration.&lt;/P&gt;&lt;P class="lia-align-left"&gt;What is the exact syntax to do to achive that?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 08:27:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-execution-time/m-p/670600#M229872</guid>
      <dc:creator>marco_carolo</dc:creator>
      <dc:date>2023-12-04T08:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Extract execution time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-execution-time/m-p/670615#M229876</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233874"&gt;@marco_carolo&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;the easiest way is to follow the GUI in stached char creation.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 10:43:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-execution-time/m-p/670615#M229876</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-12-04T10:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Extract execution time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-execution-time/m-p/670617#M229877</link>
      <description>&lt;P&gt;Sorry, I didn't get it.&lt;/P&gt;&lt;P&gt;One of requests I had was:&lt;/P&gt;&lt;P&gt;I want to see the delta for multiple execution of a particular job, in order to find out if the job is getting slower or faster.&lt;/P&gt;&lt;P&gt;I thought to do a timechart in order to find out for each job the execution delta time, I'm missing the correct way to group the timechart by the duration of each execution...&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 11:04:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-execution-time/m-p/670617#M229877</guid>
      <dc:creator>marco_carolo</dc:creator>
      <dc:date>2023-12-04T11:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Extract execution time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-execution-time/m-p/670621#M229880</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233874"&gt;@marco_carolo&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;try to adapt something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| rex "[^\[]*\[(?&amp;lt;extracted_pid&amp;gt;[^\]]*)\]\s*\[(?&amp;lt;extracted_job_name&amp;gt;[^\]]*)\]\s*\[(?&amp;lt;extracted_index&amp;gt;[^\]]+\]\s*)(?&amp;lt;msg&amp;gt;.*)"
| stats 
   earliest(_time) AS _time
   latest(_time) AS latest
   BY talend_job_name
| eval 
   duration=latest-_time
| timechart values(duration) AS duration BY talend_job_name &lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 11:22:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-execution-time/m-p/670621#M229880</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-12-04T11:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: Extract execution time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-execution-time/m-p/670625#M229882</link>
      <description>&lt;P&gt;I think there's a missing point here, that I've adapted inside my current solution.&lt;/P&gt;&lt;P&gt;The primary key here is not only the job name but the PID also. The job could be executed multiple time during the day or time span chosen, the search key is&amp;nbsp; talend_job and talend_pid in order to have unique duration...&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 12:05:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-execution-time/m-p/670625#M229882</guid>
      <dc:creator>marco_carolo</dc:creator>
      <dc:date>2023-12-04T12:05:34Z</dc:date>
    </item>
  </channel>
</rss>

