<?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: How to use folder name/path as TimeStamp in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-folder-name-path-as-TimeStamp/m-p/491857#M84060</link>
    <description>&lt;P&gt;Ideally you need to extract the part of the path that contains a date into a field first, and then run the eval against that.&lt;BR /&gt;
Assuming file_name is already extracted..&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;..your search..|rex file_name (?P&amp;lt;stringDate&amp;gt;\d{8})|eval _time=strptime(stringDate, "%m%d%Y")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Give that a go.&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jan 2020 21:37:28 GMT</pubDate>
    <dc:creator>nickhills</dc:creator>
    <dc:date>2020-01-27T21:37:28Z</dc:date>
    <item>
      <title>How to use folder name/path as TimeStamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-folder-name-path-as-TimeStamp/m-p/491856#M84059</link>
      <description>&lt;P&gt;Greetings---&lt;BR /&gt;
I am in the process of building an add-on.&lt;BR /&gt;
I am building this add-on to utilize input data stored in folders with the structure:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;basedir\APP\log\activity\MLBB\TierData\01272020\en\SA\Week.Normal.Classic.csv

basedir\APP\log\activity\MLBB\TierData\01272020\en\SA\Week.High.Classic.csv

basedir\APP\log\activity\MLBB\TierData\01272020\en\SA\Week.Very-High.Classic.csv

basedir\APP\log\activity\MLBB\TierData\01272020\en\SA\Week.All-Levels.rank.csv

basedir\APP\log\activity\MLBB\TierData\01272020\en\SA\Week.Normal.rank.csv

basedir\APP\log\activity\MLBB\TierData\01272020\en\SA\Week.High.rank.csv

basedir\APP\log\activity\MLBB\TierData\01272020\en\SA\Week.Very-High.rank.csv

basedir\APP\log\activity\MLBB\TierData\01272020\en\SA\Week.All-Levels.brawl.csv

basedir\APP\log\activity\MLBB\TierData\01272020\en\SA\Week.Normal.brawl.csv

basedir\APP\log\activity\MLBB\TierData\01272020\en\SA\Week.High.brawl.csv

basedir\APP\log\activity\MLBB\TierData\01272020\en\SA\Week.Very-High.brawl.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to use the date in the folder path (in this case, 01272020) as the Timestamp, ideally at Index Time.&lt;/P&gt;

&lt;P&gt;I see this documentation:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Data/HowSplunkextractstimestamps"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Data/HowSplunkextractstimestamps&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;And this article:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/94763/set-timestamp-based-on-file-source-path.html"&gt;https://answers.splunk.com/answers/94763/set-timestamp-based-on-file-source-path.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;But when I place:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EVAL-_time=strptime(file_name, "%m%d%Y")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in my props.conf, it didn't seem to work.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 18:20:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-folder-name-path-as-TimeStamp/m-p/491856#M84059</guid>
      <dc:creator>p3hndrx</dc:creator>
      <dc:date>2020-01-27T18:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to use folder name/path as TimeStamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-folder-name-path-as-TimeStamp/m-p/491857#M84060</link>
      <description>&lt;P&gt;Ideally you need to extract the part of the path that contains a date into a field first, and then run the eval against that.&lt;BR /&gt;
Assuming file_name is already extracted..&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;..your search..|rex file_name (?P&amp;lt;stringDate&amp;gt;\d{8})|eval _time=strptime(stringDate, "%m%d%Y")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Give that a go.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 21:37:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-folder-name-path-as-TimeStamp/m-p/491857#M84060</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2020-01-27T21:37:28Z</dc:date>
    </item>
  </channel>
</rss>

