<?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: Issue with epoch time when using strptime() function in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-epoch-time-when-using-strptime-function/m-p/347464#M102903</link>
    <description>&lt;P&gt;Yes, one of the more stupid things about this standard is that it is not reversible.  The standard time translation shows only the %Y-%m for a time that is on the first of the month but strptime does not work backwards.  &lt;/P&gt;

&lt;P&gt;I would have designed a solo year to pull the first moment of that year, but that's just me.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Aug 2017 21:27:06 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-08-03T21:27:06Z</dc:date>
    <item>
      <title>Issue with epoch time when using strptime() function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-epoch-time-when-using-strptime-function/m-p/347460#M102899</link>
      <description>&lt;P&gt;This is driving me nuts because I use strptime all the time and have many of my own working examples to reference.&lt;/P&gt;

&lt;P&gt;I was having a problem doing strptime with a more complex date that wasn't working so I kept making it more simple until even this isn't working.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval TestYear="2017" | eval TestResult=strptime(TestYear,"%Y") | table TestYear, TestResult
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Why isn't TestResult getting the epoch time for the year?  The field is not being created.  This is so simple that I'm clearly doing something dumb that I'm just too close to see.&lt;/P&gt;

&lt;P&gt;Thanks guys&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 17:20:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-epoch-time-when-using-strptime-function/m-p/347460#M102899</guid>
      <dc:creator>FeatureCreeep</dc:creator>
      <dc:date>2017-08-03T17:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with epoch time when using strptime() function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-epoch-time-when-using-strptime-function/m-p/347461#M102900</link>
      <description>&lt;P&gt;I think you may have run into a limitation of strptime.  I get the same results as you, but &lt;CODE&gt;strptime("2017/08/03","%Y/%m/%d")&lt;/CODE&gt; works ok.  What is the original date you're trying to parse?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 18:07:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-epoch-time-when-using-strptime-function/m-p/347461#M102900</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-08-03T18:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with epoch time when using strptime() function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-epoch-time-when-using-strptime-function/m-p/347462#M102901</link>
      <description>&lt;P&gt;You need minimum of month and date (%m and %d) to parse a string date using strptime. If not provided current year is taken. See this runanywhere example.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-1 | eval date1=strptime("2017","%Y") | eval date2=strptime("12","%m") | eval date3=strptime("12","%d") | eval date4=strptime("2017-08","%Y-%m") | eval date5=strptime("08-03","%m-%d") | eval date6=strptime("2017-08-03","%Y-%m-%d") | convert ctime(*) as *_human | table date*
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Aug 2017 18:17:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-epoch-time-when-using-strptime-function/m-p/347462#M102901</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-03T18:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with epoch time when using strptime() function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-epoch-time-when-using-strptime-function/m-p/347463#M102902</link>
      <description>&lt;P&gt;Ya, @somesoni2 pointed out that my "simple" example is too simple.  My original issue was with a datetime like "2017‎-‎08‎-‎03T07:43:17.125751900".  I was using "%Y-%m-%dT%H:%M:%S.%9Q" as the format string.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 21:21:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-epoch-time-when-using-strptime-function/m-p/347463#M102902</guid>
      <dc:creator>FeatureCreeep</dc:creator>
      <dc:date>2017-08-03T21:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with epoch time when using strptime() function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-epoch-time-when-using-strptime-function/m-p/347464#M102903</link>
      <description>&lt;P&gt;Yes, one of the more stupid things about this standard is that it is not reversible.  The standard time translation shows only the %Y-%m for a time that is on the first of the month but strptime does not work backwards.  &lt;/P&gt;

&lt;P&gt;I would have designed a solo year to pull the first moment of that year, but that's just me.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 21:27:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-epoch-time-when-using-strptime-function/m-p/347464#M102903</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-08-03T21:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with epoch time when using strptime() function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-epoch-time-when-using-strptime-function/m-p/347465#M102904</link>
      <description>&lt;P&gt;That's the format string I would use.  Not sure Splunk supports that level of precision, though.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2017 12:40:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-epoch-time-when-using-strptime-function/m-p/347465#M102904</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-08-04T12:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with epoch time when using strptime() function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-epoch-time-when-using-strptime-function/m-p/347466#M102905</link>
      <description>&lt;P&gt;I'm marking this answer correct because it does explain why my "simple" example of my problem wasn't working.  It turns out the my original problem was due to hidden special characters in the data string that I couldn't see unless I copied and pasted the string into an app that would display those characters.  I had to create a regex in sed mode to strip out all the special characters and my original format string worked.  Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2017 15:57:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-epoch-time-when-using-strptime-function/m-p/347466#M102905</guid>
      <dc:creator>FeatureCreeep</dc:creator>
      <dc:date>2017-08-07T15:57:59Z</dc:date>
    </item>
  </channel>
</rss>

