<?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 timestamp base on filename in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/timestamp-base-on-filename/m-p/64403#M12955</link>
    <description>&lt;P&gt;Though the row data has timestamp but I want to replace this timestamp with date of the filename.&lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;P&gt;event:20120507214400,12,10,12028593134,12038621218,10,10101,1&lt;/P&gt;

&lt;P&gt;filename:Test_20120503_000.log&lt;/P&gt;

&lt;P&gt;I want to get "20120503" instead of "20120507214400".&lt;BR /&gt;
How can I do?&lt;/P&gt;

&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 12:27:56 GMT</pubDate>
    <dc:creator>ray_cao</dc:creator>
    <dc:date>2020-09-28T12:27:56Z</dc:date>
    <item>
      <title>timestamp base on filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/timestamp-base-on-filename/m-p/64403#M12955</link>
      <description>&lt;P&gt;Though the row data has timestamp but I want to replace this timestamp with date of the filename.&lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;P&gt;event:20120507214400,12,10,12028593134,12038621218,10,10101,1&lt;/P&gt;

&lt;P&gt;filename:Test_20120503_000.log&lt;/P&gt;

&lt;P&gt;I want to get "20120503" instead of "20120507214400".&lt;BR /&gt;
How can I do?&lt;/P&gt;

&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:27:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/timestamp-base-on-filename/m-p/64403#M12955</guid>
      <dc:creator>ray_cao</dc:creator>
      <dc:date>2020-09-28T12:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: timestamp base on filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/timestamp-base-on-filename/m-p/64404#M12956</link>
      <description>&lt;P&gt;This docs section covers how Splunk assigns timestamps to events: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/HowSplunkextractstimestamps"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/HowSplunkextractstimestamps&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You might have success with setting a bogus &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt; so Splunk is forced to resort to other ways of getting timestamps.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Sep 2012 08:28:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/timestamp-base-on-filename/m-p/64404#M12956</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-09-19T08:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: timestamp base on filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/timestamp-base-on-filename/m-p/64405#M12957</link>
      <description>&lt;P&gt;Thank you for your reply.&lt;/P&gt;

&lt;P&gt;I delete the time of the events,then splunk doesn't fetch the filename's time but modification time.Splunk can't parse the filename? &lt;/P&gt;

&lt;P&gt;filename: "mmss_reference_20120211_001.log "&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:28:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/timestamp-base-on-filename/m-p/64405#M12957</guid>
      <dc:creator>ray_cao</dc:creator>
      <dc:date>2020-09-28T12:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: timestamp base on filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/timestamp-base-on-filename/m-p/64406#M12958</link>
      <description>&lt;P&gt;The only way I could think of accomplishing this would be using the transform.conf and props.conf. Below are code snippets that might get you most of the way.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/admin/Transformsconf"&gt;http://docs.splunk.com/Documentation/Splunk/latest/admin/Transformsconf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Configureindex-timefieldextraction"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/Configureindex-timefieldextraction&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;transform.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[cust-time]
REGEX = \w+_([^_]{8})
SOURCE_KEY =  source
DESK_KEY = timestamp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[custom-log]
TRANSFORMS-1=cust-time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Sep 2012 19:48:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/timestamp-base-on-filename/m-p/64406#M12958</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2012-09-19T19:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: timestamp base on filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/timestamp-base-on-filename/m-p/64407#M12959</link>
      <description>&lt;P&gt;DESK_KEY = timestamp does not exist. &lt;BR /&gt;
DESK_KEY = _time is fine, but _time must be in EPOC time.... That's my problem too.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:12:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/timestamp-base-on-filename/m-p/64407#M12959</guid>
      <dc:creator>marcoscala</dc:creator>
      <dc:date>2020-09-28T16:12:18Z</dc:date>
    </item>
  </channel>
</rss>

