<?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: Extract date from Filename source in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411176#M72809</link>
    <description>&lt;P&gt;You can do this at search time with something like this : &lt;CODE&gt;...| eval _time=_time-86400&lt;/CODE&gt;&lt;BR /&gt;
Or save that as a calculated field to have it permanently applied at search time.&lt;BR /&gt;
Best would be to go back to &lt;CODE&gt;IngestEval&lt;/CODE&gt; it's the only way to apply an eval at index time.. &lt;BR /&gt;
Or if you can manipulate your filenames, then fix it to day -1 &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jun 2019 10:12:46 GMT</pubDate>
    <dc:creator>DavidHourani</dc:creator>
    <dc:date>2019-06-10T10:12:46Z</dc:date>
    <item>
      <title>Extract date from Filename source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411169#M72802</link>
      <description>&lt;P&gt;Hi in my events I am getting time which is extracted correctly by Splunk for _time timestamp and for date extraction I want to use source field which is in format like- &lt;CODE&gt;D:\\abc\\def\\XYLog09229190601.txt.zip:.\\XYLog09229190601.txt&lt;/CODE&gt;&lt;BR /&gt;
From above source field I want to extract last 6 digit before .txt to create date like for this example it will be &lt;CODE&gt;2019-06-01&lt;/CODE&gt;.&lt;BR /&gt;
What will be best way to do that..&lt;BR /&gt;
Is it using datetime.xml? and how I can achieve it since for year only two digits are mentioned.&lt;BR /&gt;
Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 07:15:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411169#M72802</guid>
      <dc:creator>ips_mandar</dc:creator>
      <dc:date>2019-06-10T07:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date from Filename source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411170#M72803</link>
      <description>&lt;P&gt;Hi @ips_mandar,&lt;/P&gt;

&lt;P&gt;Which version are you running ?&lt;/P&gt;

&lt;P&gt;If Splunk 7.2+, have a look here : &lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Data/IngestEval"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Data/IngestEval&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;This is a pretty easy way to get time extracted at index time.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 08:07:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411170#M72803</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-06-10T08:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date from Filename source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411171#M72804</link>
      <description>&lt;P&gt;Thanks For your suggestion @DavidHourani  ..Yes I am using Splunk 7.2+ &lt;BR /&gt;
But I thought that it will impact performance so I am trying to avoid it (Ingest Eval).&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 08:39:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411171#M72804</guid>
      <dc:creator>ips_mandar</dc:creator>
      <dc:date>2019-06-10T08:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date from Filename source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411172#M72805</link>
      <description>&lt;P&gt;Yeah true, there would be an impact... In that case have you tried simply setting &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt; in your &lt;CODE&gt;props.conf&lt;/CODE&gt; ? &lt;BR /&gt;
This will first apply to the events and then fallback to the filename if it's not found in the event, so it should grab your time from there.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 08:47:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411172#M72805</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-06-10T08:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date from Filename source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411173#M72806</link>
      <description>&lt;P&gt;Currently I am trying with changing datetime.xml and if that fails then I will try TIME_FORMAT as well. So is there any performance impact if I use separate datetime.xml for app?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 09:22:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411173#M72806</guid>
      <dc:creator>ips_mandar</dc:creator>
      <dc:date>2019-06-10T09:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date from Filename source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411174#M72807</link>
      <description>&lt;P&gt;Yeap you can also do it with &lt;CODE&gt;datetime.xml&lt;/CODE&gt; it's just as good as &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt;, I thought you were looking for an easy solution that's why I didn't mention &lt;CODE&gt;datetime.xml&lt;/CODE&gt;, if you have that working stick to it ^^&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 09:26:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411174#M72807</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-06-10T09:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date from Filename source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411175#M72808</link>
      <description>&lt;P&gt;HI @DavidHourani ,&lt;BR /&gt;
I want one day before of extracted date as _time How I can achieve this?&lt;BR /&gt;
like from source I have extracted as 10 June then I want _time as 09 June..&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 09:55:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411175#M72808</guid>
      <dc:creator>ips_mandar</dc:creator>
      <dc:date>2019-06-10T09:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date from Filename source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411176#M72809</link>
      <description>&lt;P&gt;You can do this at search time with something like this : &lt;CODE&gt;...| eval _time=_time-86400&lt;/CODE&gt;&lt;BR /&gt;
Or save that as a calculated field to have it permanently applied at search time.&lt;BR /&gt;
Best would be to go back to &lt;CODE&gt;IngestEval&lt;/CODE&gt; it's the only way to apply an eval at index time.. &lt;BR /&gt;
Or if you can manipulate your filenames, then fix it to day -1 &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 10:12:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411176#M72809</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-06-10T10:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date from Filename source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411177#M72810</link>
      <description>&lt;P&gt;Thanks @DavidHourani &lt;BR /&gt;
My current problem:-&lt;BR /&gt;
my event looks like-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;31,04:56:47:928,  abc:0xabc,  49.716720, -59.271553,197
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where 31 is day of month&lt;BR /&gt;
and source field looks like - &lt;CODE&gt;D:\\abc\\def\\XYLog09229190601.txt.zip:.\\XYLog09229190601.txt&lt;/CODE&gt; &lt;BR /&gt;
So by which way I can get _time as 31 May 2019?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 13:14:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411177#M72810</guid>
      <dc:creator>ips_mandar</dc:creator>
      <dc:date>2019-06-10T13:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date from Filename source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411178#M72811</link>
      <description>&lt;P&gt;and for same source some events looks like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;30,04:56:47:928,  abc:0xabc,  49.716720, -59.271553,197
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For which I want _time as 30 May 2019&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 13:20:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411178#M72811</guid>
      <dc:creator>ips_mandar</dc:creator>
      <dc:date>2019-06-10T13:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date from Filename source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411179#M72812</link>
      <description>&lt;P&gt;ouch, so same source, different ways to extract time, is that what you mean ?  coz for both events you posted it seems you can get everything from the event itself, except the month, right ?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 13:53:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411179#M72812</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-06-10T13:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date from Filename source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411180#M72813</link>
      <description>&lt;P&gt;refer here for the exact eval to be used : &lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/751102/extract-date-timestamp-from-raw-data-and-source-fi.html"&gt;https://answers.splunk.com/answers/751102/extract-date-timestamp-from-raw-data-and-source-fi.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 06:14:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-date-from-Filename-source/m-p/411180#M72813</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-06-11T06:14:46Z</dc:date>
    </item>
  </channel>
</rss>

