<?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 convert epoch time to HH:MM:SS AFTER using stats AVG? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225807#M66594</link>
    <description>&lt;P&gt;So I have the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Index="Cyber" sourcetype=Response queue = "Incident" status ="resolved"  | dedup ticket

     | table Date_Created, Acknowledge_Date 
     | eval epoch1=strptime(Date_Created,"%Y-%m-%d %H:%M:%S") 
     | convert timeformat="%Y-%m-%d %H:%M:%S" mktime(Date_Created) as epochDateCreated
     | eval epoch2=strptime(Acknowledge_Date,"%Y-%m-%d %H:%M:%S")
     | convert timeformat="%Y-%m-%d %H:%M:%S" mktime(Acknowledge_Date) as epochAck
     | eval Diff=(epochAck-epochDateCreated)

     |stats avg(Diff)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I now have an average time it takes to acknowledge an incident in epoch format. However, I cannot use Strftime once the figure has already been averaged. Is there a way around this?&lt;/P&gt;</description>
    <pubDate>Thu, 12 Nov 2015 09:46:31 GMT</pubDate>
    <dc:creator>mjd555</dc:creator>
    <dc:date>2015-11-12T09:46:31Z</dc:date>
    <item>
      <title>How to convert epoch time to HH:MM:SS AFTER using stats AVG?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225807#M66594</link>
      <description>&lt;P&gt;So I have the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Index="Cyber" sourcetype=Response queue = "Incident" status ="resolved"  | dedup ticket

     | table Date_Created, Acknowledge_Date 
     | eval epoch1=strptime(Date_Created,"%Y-%m-%d %H:%M:%S") 
     | convert timeformat="%Y-%m-%d %H:%M:%S" mktime(Date_Created) as epochDateCreated
     | eval epoch2=strptime(Acknowledge_Date,"%Y-%m-%d %H:%M:%S")
     | convert timeformat="%Y-%m-%d %H:%M:%S" mktime(Acknowledge_Date) as epochAck
     | eval Diff=(epochAck-epochDateCreated)

     |stats avg(Diff)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I now have an average time it takes to acknowledge an incident in epoch format. However, I cannot use Strftime once the figure has already been averaged. Is there a way around this?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2015 09:46:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225807#M66594</guid>
      <dc:creator>mjd555</dc:creator>
      <dc:date>2015-11-12T09:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert epoch time to HH:MM:SS AFTER using stats AVG?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225808#M66595</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats avg(Diff) AS avgDiff | fieldformat avgDiff=tostring(avgDiff, "duration") | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Nov 2015 18:32:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225808#M66595</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-11-12T18:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert epoch time to HH:MM:SS AFTER using stats AVG?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225809#M66596</link>
      <description>&lt;P&gt;&lt;EM&gt;confetti&lt;/EM&gt; @richgalloway &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I just noticed my upvote put you over the 10,000 karma milestone. Congrats and well deserved!&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 00:37:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225809#M66596</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2015-11-13T00:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert epoch time to HH:MM:SS AFTER using stats AVG?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225810#M66597</link>
      <description>&lt;P&gt;Thanks, ppablo!&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 01:13:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225810#M66597</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-11-13T01:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert epoch time to HH:MM:SS AFTER using stats AVG?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225811#M66598</link>
      <description>&lt;P&gt;Added more :confetti: to the party !!!!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 01:16:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225811#M66598</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-11-13T01:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert epoch time to HH:MM:SS AFTER using stats AVG?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225812#M66599</link>
      <description>&lt;P&gt;Afraid this didn't work as it just returned a blank value&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 13:39:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225812#M66599</guid>
      <dc:creator>mjd555</dc:creator>
      <dc:date>2015-11-18T13:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert epoch time to HH:MM:SS AFTER using stats AVG?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225813#M66600</link>
      <description>&lt;P&gt;I just noticed a typo in the fieldformat command.  Try the new answer.  If it still doesn't work, please post your new search.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 14:08:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225813#M66600</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-11-18T14:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert epoch time to HH:MM:SS AFTER using stats AVG?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225814#M66601</link>
      <description>&lt;P&gt;Perfect, that has given me an answer of: 03:25:04.487179 &lt;/P&gt;

&lt;P&gt;Is there a way to round this?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 14:16:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225814#M66601</guid>
      <dc:creator>mjd555</dc:creator>
      <dc:date>2015-11-18T14:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert epoch time to HH:MM:SS AFTER using stats AVG?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225815#M66602</link>
      <description>&lt;P&gt;Try substr.  Adjust the second number to get the length you want.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval avgDiff=substr(avgDiff, 1, 8) | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Nov 2015 14:31:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225815#M66602</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-11-18T14:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert epoch time to HH:MM:SS AFTER using stats AVG?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225816#M66603</link>
      <description>&lt;P&gt;Amazing, thanks for your help!!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 14:36:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225816#M66603</guid>
      <dc:creator>mjd555</dc:creator>
      <dc:date>2015-11-18T14:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert epoch time to HH:MM:SS AFTER using stats AVG?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225817#M66604</link>
      <description>&lt;P&gt;Please accept the answer.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 14:40:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-epoch-time-to-HH-MM-SS-AFTER-using-stats-AVG/m-p/225817#M66604</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-11-18T14:40:00Z</dc:date>
    </item>
  </channel>
</rss>

