<?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: how to get my duration from transaction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-my-duration-from-transaction/m-p/483104#M135286</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;DESCRIPTION="sump pump" OR (DESCRIPTION="ejector pump" AND DESCRIPTION="run/stop") 
| eval TIMEONLY =strptime(CREATEDATETIME ,"%m/%d/%Y %T %p")
| eventstats range(TIMEONLY) as duration by DESCRIPTION
| eval duration=tostring(duration,"duration")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 26 Feb 2020 22:26:20 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-02-26T22:26:20Z</dc:date>
    <item>
      <title>how to get my duration from transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-my-duration-from-transaction/m-p/483102#M135284</link>
      <description>&lt;P&gt;my search query is this:&lt;/P&gt;

&lt;P&gt;DESCRIPTION="&lt;EM&gt;sump pump&lt;/EM&gt;" OR (DESCRIPTION="&lt;EM&gt;ejector pump&lt;/EM&gt;" AND DESCRIPTION="&lt;EM&gt;run/stop&lt;/EM&gt;") | rex field=CREATEDATETIME "2019+ (?[^,]+)" | rex field=CREATEDATETIME "(?[^\s]+)" | rex field=TIMEONLY "(?.&lt;EM&gt;):(?.&lt;/EM&gt;):(?.&lt;EM&gt;)\s(?.&lt;/EM&gt;)" | eval TIMEONLY = Hour*3600 + Minute*60 + Second| eval AM=case(AM="AM","0",AM="PM","43200")|eval TIMEONLY=TIMEONLY+AM| sort by !TIMEONLY |transaction DESCRIPTION startswith=VALUE="RUN" endswith=VALUE="STOP"&lt;/P&gt;

&lt;P&gt;result i get from search:&lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/284585-splunk.jpg" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;i have created a field for the TIMEONLY , i am stuck with getting the duration of the time between the run and stop time, what can i do such that i am able to subtract my run and stop time to get the active time duration .&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:24:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-my-duration-from-transaction/m-p/483102#M135284</guid>
      <dc:creator>chookp</dc:creator>
      <dc:date>2020-09-30T04:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to get my duration from transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-my-duration-from-transaction/m-p/483103#M135285</link>
      <description>&lt;P&gt;HI @chookp,&lt;BR /&gt;
the duration field that's displayed if there the transaction command isn't useful for you?&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 13:47:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-my-duration-from-transaction/m-p/483103#M135285</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-02-26T13:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to get my duration from transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-my-duration-from-transaction/m-p/483104#M135286</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;DESCRIPTION="sump pump" OR (DESCRIPTION="ejector pump" AND DESCRIPTION="run/stop") 
| eval TIMEONLY =strptime(CREATEDATETIME ,"%m/%d/%Y %T %p")
| eventstats range(TIMEONLY) as duration by DESCRIPTION
| eval duration=tostring(duration,"duration")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Feb 2020 22:26:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-my-duration-from-transaction/m-p/483104#M135286</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-26T22:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to get my duration from transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-my-duration-from-transaction/m-p/483105#M135287</link>
      <description>&lt;P&gt;the transaction command is useful to me, but the info i need to lacking, when i use the transaction there is multi value of TIMEONLY , i just need to subtract both my TIMEONLY to get my active duration. this is the part which i am stuck&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 00:27:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-my-duration-from-transaction/m-p/483105#M135287</guid>
      <dc:creator>chookp</dc:creator>
      <dc:date>2020-02-27T00:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to get my duration from transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-my-duration-from-transaction/m-p/483106#M135288</link>
      <description>&lt;P&gt;hi i am sorry as i am new to splunk i am not sure  eval |TIMEONLY =strptime(CREATEDATETIME ,"%m/%d/%Y %T %p") | eventstats range(TIMEONLY) as duration by DESCRIPTION | eval duration=tostring(duration,"duration") able to break down the meaning i had try to use the command but did not get the answer i expected.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 06:03:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-my-duration-from-transaction/m-p/483106#M135288</guid>
      <dc:creator>chookp</dc:creator>
      <dc:date>2020-02-27T06:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to get my duration from transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-my-duration-from-transaction/m-p/483107#M135289</link>
      <description>&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/SearchReference/Commontimeformatvariables"&gt;strptime&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/SearchReference/Eventstats"&gt;eventstats&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/SearchReference/Aggregatefunctions"&gt;range&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/SearchReference/ConversionFunctions"&gt;tostring&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 08:37:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-my-duration-from-transaction/m-p/483107#M135289</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-27T08:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to get my duration from transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-my-duration-from-transaction/m-p/483108#M135290</link>
      <description>&lt;P&gt;CREATEDATETIME is format &lt;CODE&gt;"%m/%d/%Y %T %p"&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;strptime&lt;/CODE&gt; makes epoch time to duration.&lt;BR /&gt;
&lt;CODE&gt;eventstats range&lt;/CODE&gt; aggregates duration between &lt;EM&gt;run and stop&lt;/EM&gt;&lt;BR /&gt;
&lt;CODE&gt;tostring&lt;/CODE&gt; change duration to readable.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 08:45:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-my-duration-from-transaction/m-p/483108#M135290</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-27T08:45:46Z</dc:date>
    </item>
  </channel>
</rss>

