<?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: Extracting date from file name via custom datetime.xml not working... in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-date-from-file-name-via-custom-datetime-xml-not/m-p/146118#M29762</link>
    <description>&lt;P&gt;What date is Splunk indexing it?  The last modified date?  That is what my file is being indexed as. I have no field inside my csv to represent time or date.  Does yours? &lt;/P&gt;</description>
    <pubDate>Mon, 16 Feb 2015 14:58:53 GMT</pubDate>
    <dc:creator>kphillipson</dc:creator>
    <dc:date>2015-02-16T14:58:53Z</dc:date>
    <item>
      <title>Extracting date from file name via custom datetime.xml not working...</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-date-from-file-name-via-custom-datetime-xml-not/m-p/146115#M29759</link>
      <description>&lt;P&gt;All,&lt;/P&gt;

&lt;P&gt;Here is the file name and my datetime.xml config. When I apply this and try to import the data, Splunk gets stuck in preview and never shows the data.&lt;/P&gt;

&lt;P&gt;Thanks in advance for the assist!&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;File Name:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;ADESS_FANALL_01082014_01172014_195441.csv&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Datetime.xml Config&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;datetime&amp;gt;

&amp;lt;define name="_masheddate3" extract="month, day, year"&amp;gt;
        &amp;lt;text&amp;gt;&amp;lt;![CDATA[(?:^|source::|source:).*?ADESS_FANALL_([01]\d)([0123]\d)(20[01]\d)]]&amp;gt;&amp;lt;/text&amp;gt;
&amp;lt;/define&amp;gt;

&amp;lt;datePatterns&amp;gt;
        &amp;lt;use name="_masheddate3"/&amp;gt;
&amp;lt;/datePatterns&amp;gt;

&amp;lt;/datetime&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:51:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-date-from-file-name-via-custom-datetime-xml-not/m-p/146115#M29759</guid>
      <dc:creator>sf-mike</dc:creator>
      <dc:date>2020-09-28T15:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting date from file name via custom datetime.xml not working...</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-date-from-file-name-via-custom-datetime-xml-not/m-p/146116#M29760</link>
      <description>&lt;P&gt;I myself have the same problem with a file name like the one above. Your xml output looks ok.  &lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2015 01:44:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-date-from-file-name-via-custom-datetime-xml-not/m-p/146116#M29760</guid>
      <dc:creator>kphillipson</dc:creator>
      <dc:date>2015-02-13T01:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting date from file name via custom datetime.xml not working...</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-date-from-file-name-via-custom-datetime-xml-not/m-p/146117#M29761</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;ADESS_FANALL_(\d{2})(\d{2})20(\d{2})
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;might help.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2015 06:32:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-date-from-file-name-via-custom-datetime-xml-not/m-p/146117#M29761</guid>
      <dc:creator>ramdaspr</dc:creator>
      <dc:date>2015-02-13T06:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting date from file name via custom datetime.xml not working...</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-date-from-file-name-via-custom-datetime-xml-not/m-p/146118#M29762</link>
      <description>&lt;P&gt;What date is Splunk indexing it?  The last modified date?  That is what my file is being indexed as. I have no field inside my csv to represent time or date.  Does yours? &lt;/P&gt;</description>
      <pubDate>Mon, 16 Feb 2015 14:58:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-date-from-file-name-via-custom-datetime-xml-not/m-p/146118#M29762</guid>
      <dc:creator>kphillipson</dc:creator>
      <dc:date>2015-02-16T14:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting date from file name via custom datetime.xml not working...</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-date-from-file-name-via-custom-datetime-xml-not/m-p/146119#M29763</link>
      <description>&lt;P&gt;Did you remove all of configuration from datetime.xml? Why don't you copy datetime.xml from /etc to your directory?&lt;BR /&gt;
I got the same situation and I resolved that like below.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;copy datetime.xml to specific directory.&lt;BR /&gt;
cp -p /home/splunk/etc/datetime.xml /home/splunk/etc/system/local/my_datetime.xml&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;configure props.conf&lt;BR /&gt;
[mysourcetype]&lt;BR /&gt;
DATETIME_CONFIG = /etc/system/local/my_datetime.xml&lt;BR /&gt;
...&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Put your datetime configuration to my_datetime.xml (I didn't remove anything from my_datetime.xml)&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;restart Splunk and monitor file&lt;BR /&gt;
At that moment,I saw my test file name of ADESS_FANALL_01082014_01172014_195441.csv was indexed with expected timestamp. (14/01/08 xx:xx:xx.xxx)&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:38:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-date-from-file-name-via-custom-datetime-xml-not/m-p/146119#M29763</guid>
      <dc:creator>1500372</dc:creator>
      <dc:date>2020-09-29T09:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting date from file name via custom datetime.xml not working...</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-date-from-file-name-via-custom-datetime-xml-not/m-p/146120#M29764</link>
      <description>&lt;P&gt;Hello @1500372,&lt;/P&gt;

&lt;P&gt;I have followed same steps which you have mentioned in comment but am not getting any date extraction. Could you please help me &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;copy datetime.xml to specific directory.
cp -p /home/splunk/etc/datetime.xml /home/splunk/etc/system/local/my_datetime.xml

configure props.conf
[mysourcetype]
DATETIME_CONFIG = /etc/system/local/my_datetime.xml
...

Put your datetime configuration to my_datetime.xml (I didn't remove anything from my_datetime.xml)

restart Splunk and monitor file
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks in Adavance&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 06:32:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-date-from-file-name-via-custom-datetime-xml-not/m-p/146120#M29764</guid>
      <dc:creator>snehalk</dc:creator>
      <dc:date>2017-09-18T06:32:59Z</dc:date>
    </item>
  </channel>
</rss>

