<?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: _time From file Name in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/time-From-file-Name/m-p/198724#M39384</link>
    <description>&lt;P&gt;Regular expression I have corrected to ABC_(\d{4})(\d{2})(\d{2}) to get the groups.&lt;BR /&gt;
Myhost hame is DateFormat and and I have corrected to refereeing as&lt;BR /&gt;
$SPLUNK_HOME/etc/system/local/datetime.xml.&lt;BR /&gt;
But still I am getting same result(_time with current time).&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 16:13:32 GMT</pubDate>
    <dc:creator>jimjohn</dc:creator>
    <dc:date>2020-09-28T16:13:32Z</dc:date>
    <item>
      <title>_time From file Name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/time-From-file-Name/m-p/198720#M39380</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;

&lt;P&gt;I want splunk to populate &lt;CODE&gt;_time&lt;/CODE&gt; field with value from file name.&lt;BR /&gt;
for ex my file name is ABC_20140131 I want &lt;CODE&gt;_time&lt;/CODE&gt; field with value 01/31/2014.&lt;BR /&gt;
I looked &lt;A href="http://blogs.splunk.com/2009/12/02/configure-splunk-to-pull-a-date-out-of-a-non-standard-filename/" target="_blank"&gt;http://blogs.splunk.com/2009/12/02/configure-splunk-to-pull-a-date-out-of-a-non-standard-filename/&lt;/A&gt; &lt;BR /&gt;
and tried the configerations exaplined .But still I am getting &lt;CODE&gt;_time&lt;/CODE&gt; as current time.&lt;BR /&gt;
My changes are as follows.&lt;BR /&gt;
etc\system\default\props.config&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[host::DateFormat]
DATETIME_CONFIG =/etc/system/local/datetime.xml
TIME_PREFIX=ABC_
MAX_TIMESTAMP_LOOKAHEAD=20
TIME_FORMAT = %Y%m%d
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;datetime.xml&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;define name="_isodate" extract="year, month, day"&amp;gt;
       &amp;lt;text&amp;gt;&amp;lt;![CDATA[source::ABC_\d{4}\d{2}\d{2}.*]]&amp;gt;&amp;lt;/text&amp;gt;
&amp;lt;/define&amp;gt;
&amp;lt;datePatterns&amp;gt;
      &amp;lt;use name="_isodate"/&amp;gt;
&amp;lt;/datePatterns&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Did I miss anything or can somebody give some suggestions on this. &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:13:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/time-From-file-Name/m-p/198720#M39380</guid>
      <dc:creator>jimjohn</dc:creator>
      <dc:date>2020-09-28T16:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: _time From file Name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/time-From-file-Name/m-p/198721#M39381</link>
      <description>&lt;P&gt;Hi, I don't have much experience with custom datetime.xml configs, but one thing that looks suspicious is that you do not have any capturing groups in your regex, so splunk does not know which parts to extract as "year, month, day". You should probably have it more like;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ABC_(\d{4})(\d{2})(\d{2})
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but there might be more things missing.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2014 07:26:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/time-From-file-Name/m-p/198721#M39381</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2014-03-25T07:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: _time From file Name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/time-From-file-Name/m-p/198722#M39382</link>
      <description>&lt;P&gt;Also is your host really called "DateFormat"??&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2014 07:53:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/time-From-file-Name/m-p/198722#M39382</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2014-03-25T07:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: _time From file Name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/time-From-file-Name/m-p/198723#M39383</link>
      <description>&lt;P&gt;and is your &lt;CODE&gt;datetime.xml&lt;/CODE&gt; really in &lt;CODE&gt;/etc/system/local&lt;/CODE&gt; or in &lt;CODE&gt;$SPLUNK_HOME/etc/system/local/&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2014 08:04:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/time-From-file-Name/m-p/198723#M39383</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-03-25T08:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: _time From file Name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/time-From-file-Name/m-p/198724#M39384</link>
      <description>&lt;P&gt;Regular expression I have corrected to ABC_(\d{4})(\d{2})(\d{2}) to get the groups.&lt;BR /&gt;
Myhost hame is DateFormat and and I have corrected to refereeing as&lt;BR /&gt;
$SPLUNK_HOME/etc/system/local/datetime.xml.&lt;BR /&gt;
But still I am getting same result(_time with current time).&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:13:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/time-From-file-Name/m-p/198724#M39384</guid>
      <dc:creator>jimjohn</dc:creator>
      <dc:date>2020-09-28T16:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: _time From file Name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/time-From-file-Name/m-p/198725#M39385</link>
      <description>&lt;P&gt;You should check splunkd.log for errors from the timestamp processor.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2014 09:39:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/time-From-file-Name/m-p/198725#M39385</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2014-03-25T09:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: _time From file Name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/time-From-file-Name/m-p/198726#M39386</link>
      <description>&lt;P&gt;It says that &lt;/P&gt;

&lt;P&gt;"If no events in a source have a date, Splunk Enterprise tries to find one in the source name or file name. (This requires that the events have a time, even though they don't have a date.)"&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jan 2015 15:51:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/time-From-file-Name/m-p/198726#M39386</guid>
      <dc:creator>kiddo258</dc:creator>
      <dc:date>2015-01-22T15:51:33Z</dc:date>
    </item>
  </channel>
</rss>

