<?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() format for yyyymmddhhmmss? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/strptime-format-for-yyyymmddhhmmss/m-p/14297#M1446</link>
    <description>&lt;P&gt;No, it will not get that format, though it might be able to get the date if the timestamps are in the file. If there is nothing in the file that can be misinterpreted as the date (which after all is just a 14-digit number), you may be able to use TIME_FORMAT. Otherwise, you should define a custom datetime.xml file.&lt;/P&gt;</description>
    <pubDate>Wed, 26 May 2010 21:46:21 GMT</pubDate>
    <dc:creator>gkanapathy</dc:creator>
    <dc:date>2010-05-26T21:46:21Z</dc:date>
    <item>
      <title>strptime() format for yyyymmddhhmmss?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/strptime-format-for-yyyymmddhhmmss/m-p/14294#M1443</link>
      <description>&lt;P&gt;strptime() format expression examples&lt;/P&gt;

&lt;P&gt;Below are some sample date formats with strptime() expressions that handle them.&lt;/P&gt;

&lt;P&gt;1998-12-31   %Y-%m-%d
98-12-31     %y-%m-%d
1998 years, 312 days     %Y years, %j days
Jan 24, 2003     %b %d, %Y
January 24, 2003     %B %d, %Y
q|25 Feb '03 = 2003-02-25|  q|%d %b '%y = %Y-%m-%d| &lt;/P&gt;

&lt;P&gt;does one exist for   yyyymmddhhmmss?    &lt;/P&gt;

&lt;P&gt;my source field will look like this /dir/to/file/on/20100526123445/file.txt&lt;/P&gt;

&lt;P&gt;curious if the dynamic date extraction could figure this out.&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2010 21:33:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/strptime-format-for-yyyymmddhhmmss/m-p/14294#M1443</guid>
      <dc:creator>hiddenkirby</dc:creator>
      <dc:date>2010-05-26T21:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: strptime() format for yyyymmddhhmmss?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/strptime-format-for-yyyymmddhhmmss/m-p/14295#M1444</link>
      <description>&lt;P&gt;You should use something like %Y%m%d%H%M%S&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2010 21:36:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/strptime-format-for-yyyymmddhhmmss/m-p/14295#M1444</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2010-05-26T21:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: strptime() format for yyyymmddhhmmss?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/strptime-format-for-yyyymmddhhmmss/m-p/14296#M1445</link>
      <description>&lt;P&gt;For extractions from a path, open up the &lt;CODE&gt;$SPLUNK_HOME/etc/datetime.xml&lt;/CODE&gt; and search for entries prefixed with &lt;CODE&gt;source::&lt;/CODE&gt;.  It doesn't look like one exists right now, but you would probably have to add one.  Since your timestamp has no breakers in it (there are no non-digits after the &lt;CODE&gt;yyyymmmdd&lt;/CODE&gt; portion) then nothing in the source will match, based on the existing rexes in &lt;CODE&gt;datetime.xml&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I see you've had some other questions on this topic.  I'm guessing that creating your own &lt;CODE&gt;datetime.xml&lt;/CODE&gt; and it isn't working.  Is that correct?  If you post what you've tried someone may be able to help track it down.&lt;/P&gt;

&lt;P&gt;And just for the record, the &lt;CODE&gt;datetime.xml&lt;/CODE&gt; file uses all regexes, and is not a &lt;CODE&gt;strptime()&lt;/CODE&gt; thing at all.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;If you're looking to setup an entry for a &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt; entry in a &lt;CODE&gt;props.conf&lt;/CODE&gt; file?  If so, try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_FORMAT = %Y%m%d%H%M%S
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 May 2010 21:36:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/strptime-format-for-yyyymmddhhmmss/m-p/14296#M1445</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-05-26T21:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: strptime() format for yyyymmddhhmmss?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/strptime-format-for-yyyymmddhhmmss/m-p/14297#M1446</link>
      <description>&lt;P&gt;No, it will not get that format, though it might be able to get the date if the timestamps are in the file. If there is nothing in the file that can be misinterpreted as the date (which after all is just a 14-digit number), you may be able to use TIME_FORMAT. Otherwise, you should define a custom datetime.xml file.&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2010 21:46:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/strptime-format-for-yyyymmddhhmmss/m-p/14297#M1446</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-05-26T21:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: strptime() format for yyyymmddhhmmss?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/strptime-format-for-yyyymmddhhmmss/m-p/14298#M1447</link>
      <description>&lt;P&gt;this worked... HOWEVER... it only worked if i specified  TIME_PREFIX.&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2010 21:49:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/strptime-format-for-yyyymmddhhmmss/m-p/14298#M1447</guid>
      <dc:creator>hiddenkirby</dc:creator>
      <dc:date>2010-05-26T21:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: strptime() format for yyyymmddhhmmss?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/strptime-format-for-yyyymmddhhmmss/m-p/14299#M1448</link>
      <description>&lt;P&gt;if it was /home/kirb/logs/20100521123456/file.txt    TIME_PREFIX=\/logs\/     TIME_FORMAT=%Y%m%d%H%M%S&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:12:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/strptime-format-for-yyyymmddhhmmss/m-p/14299#M1448</guid>
      <dc:creator>hiddenkirby</dc:creator>
      <dc:date>2020-09-28T09:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: strptime() format for yyyymmddhhmmss?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/strptime-format-for-yyyymmddhhmmss/m-p/14300#M1449</link>
      <description>&lt;P&gt;Is the name (full path) of the log file stored within the log file itself?  I didn't think you could use a &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; to match against source.&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2010 21:55:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/strptime-format-for-yyyymmddhhmmss/m-p/14300#M1449</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-05-26T21:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: strptime() format for yyyymmddhhmmss?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/strptime-format-for-yyyymmddhhmmss/m-p/14301#M1450</link>
      <description>&lt;P&gt;I miss understood what TIME_PREFIX did.   The closer i look at the results of the indexing ... i notice it didn't work.  There were a bunch of coincidental matches on information w/in the file. &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2010 20:24:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/strptime-format-for-yyyymmddhhmmss/m-p/14301#M1450</guid>
      <dc:creator>hiddenkirby</dc:creator>
      <dc:date>2010-05-27T20:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: strptime() format for yyyymmddhhmmss?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/strptime-format-for-yyyymmddhhmmss/m-p/14302#M1451</link>
      <description>&lt;P&gt;I tried &lt;A href="http://www.splunk.com/base/Documentation/4.1.2/Admin/TrainSplunkToRecognizeATimestamp"&gt;http://www.splunk.com/base/Documentation/4.1.2/Admin/TrainSplunkToRecognizeATimestamp&lt;/A&gt;   to help build the regex on "/dir/to/file/on/20100526123445/file.txt"   to parse the date fields... but to no avail.   I wanted to use that regex for my _masheddate3 in a local datetime.xml for my app.    Am i closer?&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2010 20:55:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/strptime-format-for-yyyymmddhhmmss/m-p/14302#M1451</guid>
      <dc:creator>hiddenkirby</dc:creator>
      <dc:date>2010-05-27T20:55:20Z</dc:date>
    </item>
  </channel>
</rss>

