<?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: strptime conversion difficulty from a string in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/strptime-conversion-difficulty-from-a-string/m-p/481956#M135040</link>
    <description>&lt;P&gt;That &lt;CODE&gt;strptime&lt;/CODE&gt; format string doesn't match the data.  Try &lt;CODE&gt;%-%b-%y %h.%M.%S.%6N %p %Z&lt;/CODE&gt;.  I'm not sure Splunk will recognize "AMERICA/CHICAGO" as time zone identifier, though.&lt;/P&gt;</description>
    <pubDate>Mon, 11 Nov 2019 16:27:16 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2019-11-11T16:27:16Z</dc:date>
    <item>
      <title>strptime conversion difficulty from a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/strptime-conversion-difficulty-from-a-string/m-p/481955#M135039</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am having difficulty getting the strptime function to properly convert my date string into a usable and accurate time stamp.  Here is an example of the string and the strptime function I have tried.  Can you help with the proper conversion please?&lt;/P&gt;

&lt;P&gt;string=&lt;STRONG&gt;05-NOV-19 10.53.49.287000 AM AMERICA/CHICAGO&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;This did not work: &lt;STRONG&gt;| eval first_res_time = strptime(previous_resolution_time, "%d/%B/%y %H/%M/%S/%N")&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Thank you,&lt;/P&gt;

&lt;P&gt;-MD&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:56:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/strptime-conversion-difficulty-from-a-string/m-p/481955#M135039</guid>
      <dc:creator>mdurdel</dc:creator>
      <dc:date>2020-09-30T02:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: strptime conversion difficulty from a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/strptime-conversion-difficulty-from-a-string/m-p/481956#M135040</link>
      <description>&lt;P&gt;That &lt;CODE&gt;strptime&lt;/CODE&gt; format string doesn't match the data.  Try &lt;CODE&gt;%-%b-%y %h.%M.%S.%6N %p %Z&lt;/CODE&gt;.  I'm not sure Splunk will recognize "AMERICA/CHICAGO" as time zone identifier, though.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 16:27:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/strptime-conversion-difficulty-from-a-string/m-p/481956#M135040</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-11-11T16:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: strptime conversion difficulty from a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/strptime-conversion-difficulty-from-a-string/m-p/481957#M135041</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval string="05-NOV-19 10.53.49.287000 AM AMERICA/CHICAGO" 
| eval first_res_time=strptime(string, "%d-%b-%y %I.%M.%S.%6N %p")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For timezone, you may need to make changes in the props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TZ=America/Chicago
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Refer &lt;A href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones"&gt;https://en.wikipedia.org/wiki/List_of_tz_database_time_zones&lt;/A&gt;&lt;BR /&gt;
Splunk docs &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/Data/Applytimezoneoffsetstotimestamps"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.0/Data/Applytimezoneoffsetstotimestamps&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 17:23:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/strptime-conversion-difficulty-from-a-string/m-p/481957#M135041</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2019-11-11T17:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: strptime conversion difficulty from a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/strptime-conversion-difficulty-from-a-string/m-p/481958#M135042</link>
      <description>&lt;P&gt;Thank you @mayurr98 &lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 18:19:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/strptime-conversion-difficulty-from-a-string/m-p/481958#M135042</guid>
      <dc:creator>mdurdel</dc:creator>
      <dc:date>2019-11-11T18:19:47Z</dc:date>
    </item>
  </channel>
</rss>

