<?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 this string into a usable time format? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-this-string-into-a-usable-time-format/m-p/334662#M99453</link>
    <description>&lt;P&gt;Hi and thanks in advance,&lt;/P&gt;

&lt;P&gt;I am trying to convert the following time example field:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2017-03-02T09:41:38.405Z    
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;into a Splunk time format so I can get time windows to use in streamstats. &lt;BR /&gt;
thing is with the T in the middle and the Z at the end, all the tries I am doing with strptime are failing.&lt;BR /&gt;
I tried the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eval time=strptime(timeValue,"%Y-%m-%dT%H:%M:%S.%3QZ") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but no luck, any idea?&lt;/P&gt;

&lt;P&gt;Rgds,&lt;BR /&gt;
Juan&lt;/P&gt;</description>
    <pubDate>Fri, 03 Mar 2017 02:41:40 GMT</pubDate>
    <dc:creator>jperezes</dc:creator>
    <dc:date>2017-03-03T02:41:40Z</dc:date>
    <item>
      <title>How to convert this string into a usable time format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-this-string-into-a-usable-time-format/m-p/334662#M99453</link>
      <description>&lt;P&gt;Hi and thanks in advance,&lt;/P&gt;

&lt;P&gt;I am trying to convert the following time example field:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2017-03-02T09:41:38.405Z    
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;into a Splunk time format so I can get time windows to use in streamstats. &lt;BR /&gt;
thing is with the T in the middle and the Z at the end, all the tries I am doing with strptime are failing.&lt;BR /&gt;
I tried the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eval time=strptime(timeValue,"%Y-%m-%dT%H:%M:%S.%3QZ") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but no luck, any idea?&lt;/P&gt;

&lt;P&gt;Rgds,&lt;BR /&gt;
Juan&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 02:41:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-this-string-into-a-usable-time-format/m-p/334662#M99453</guid>
      <dc:creator>jperezes</dc:creator>
      <dc:date>2017-03-03T02:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert this string into a usable time format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-this-string-into-a-usable-time-format/m-p/334663#M99454</link>
      <description>&lt;P&gt;2017-03-02T09:41:38.405Z&lt;/P&gt;

&lt;P&gt;Like this (The trailing &lt;CODE&gt;Z&lt;/CODE&gt; is for &lt;CODE&gt;Zulu&lt;/CODE&gt;, AKA &lt;CODE&gt;GMT&lt;/CODE&gt; so you need to grab the &lt;CODE&gt;TZ&lt;/CODE&gt; with &lt;CODE&gt;%Z&lt;/CODE&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval time=strptime(timeValue,"%Y-%m-%dT%H:%M:%S.%3N%Z")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Mar 2017 02:54:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-this-string-into-a-usable-time-format/m-p/334663#M99454</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-03T02:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert this string into a usable time format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-this-string-into-a-usable-time-format/m-p/334664#M99455</link>
      <description>&lt;P&gt;Thanks, sorry for late reply but was trying bits and pieces but couldn't get what I wanted; get the streamstats based on next time specifiead in the json data, not the arrival time. So far no luck on all my tries, not sure if is possible. Will post another question.&lt;/P&gt;

&lt;P&gt;Thanks anyway.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 11:04:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-this-string-into-a-usable-time-format/m-p/334664#M99455</guid>
      <dc:creator>jperezes</dc:creator>
      <dc:date>2017-03-08T11:04:23Z</dc:date>
    </item>
  </channel>
</rss>

