<?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: Help converting time format and age in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Help-converting-time-format-and-age/m-p/439464#M76624</link>
    <description>&lt;P&gt;Well, try it with your real events. The provided answer has &lt;CODE&gt;2019-05-02T19:43:00.0000000Z&lt;/CODE&gt; hard coded.&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Mon, 06 May 2019 20:28:50 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2019-05-06T20:28:50Z</dc:date>
    <item>
      <title>Help converting time format and age</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-converting-time-format-and-age/m-p/439461#M76621</link>
      <description>&lt;P&gt;I have a time format field "2019-05-02T19:43:00.0000000Z" and need two things:  a) convert to y-m-d h:m:s format and b) calculate age (ex. older than 12 hours).  What is the best approach to this?  Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2019 21:32:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-converting-time-format-and-age/m-p/439461#M76621</guid>
      <dc:creator>devsupport</dc:creator>
      <dc:date>2019-05-05T21:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help converting time format and age</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-converting-time-format-and-age/m-p/439462#M76622</link>
      <description>&lt;P&gt;Hi devsupport,&lt;/P&gt;

&lt;P&gt;take a look at this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval foo="2019-05-02T19:43:00.0000000Z", myEpoch=strptime(foo, "%Y-%m-%dT%H:%M:%S.%7NZ"), "a)"=strftime(myEpoch, "%Y-%m-%d %H:%M:%S"), "b)"=tostring(now() - myEpoch, "duration")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will create the time stamp in your expected format and calculates the age since it occurred.&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 01:30:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-converting-time-format-and-age/m-p/439462#M76622</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2019-05-06T01:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help converting time format and age</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-converting-time-format-and-age/m-p/439463#M76623</link>
      <description>&lt;P&gt;Thank you Mus.  When running the query, the b column returns this:  &lt;STRONG&gt;3+17:35:59.000000&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Can that number be changed to round to the nearest hour?  Appreciate the help.&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 20:24:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-converting-time-format-and-age/m-p/439463#M76623</guid>
      <dc:creator>devsupport</dc:creator>
      <dc:date>2019-05-06T20:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help converting time format and age</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-converting-time-format-and-age/m-p/439464#M76624</link>
      <description>&lt;P&gt;Well, try it with your real events. The provided answer has &lt;CODE&gt;2019-05-02T19:43:00.0000000Z&lt;/CODE&gt; hard coded.&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 20:28:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-converting-time-format-and-age/m-p/439464#M76624</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2019-05-06T20:28:50Z</dc:date>
    </item>
  </channel>
</rss>

