<?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 do you Import data from .txt files from folders within a folder? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-Import-data-from-txt-files-from-folders-within-a/m-p/457477#M79049</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;It seems that because in some .txt files i have added date, and in some i didn't, those without date are getting "calculated" date.&lt;/P&gt;

&lt;P&gt;I have to test my theory before i can conclude this.&lt;/P&gt;

&lt;P&gt;Thank you all.&lt;/P&gt;

&lt;P&gt;Bogdan.&lt;/P&gt;</description>
    <pubDate>Thu, 28 Mar 2019 11:40:50 GMT</pubDate>
    <dc:creator>bogdan_nicolesc</dc:creator>
    <dc:date>2019-03-28T11:40:50Z</dc:date>
    <item>
      <title>How do you Import data from .txt files from folders within a folder?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-Import-data-from-txt-files-from-folders-within-a/m-p/457473#M79045</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;Ok, so I have a folder that contains other folders, that in turn contain a folder, which, bare with me here, in turn contains txt files.&lt;/P&gt;

&lt;P&gt;All clear for now?&lt;/P&gt;

&lt;P&gt;The problem: I want to import the data from those .txt files into Splunk, so I can search various inputs from those .txt files. For some reason, Splunk indexes data from those .txt files but with a wrong time stamp. Others are indexed with modified file time stamp. Others get indexed with I don't know what time stamp.&lt;/P&gt;

&lt;P&gt;Quick side note: I already managed to import data, so I can look for what I need.&lt;/P&gt;

&lt;P&gt;Question/Issue: how can I tell Splunk to look for the time modified from the .txt file?&lt;/P&gt;

&lt;P&gt;Thank you,&lt;/P&gt;

&lt;P&gt;Bogdan&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2019 19:48:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-Import-data-from-txt-files-from-folders-within-a/m-p/457473#M79045</guid>
      <dc:creator>bogdan_nicolesc</dc:creator>
      <dc:date>2019-03-27T19:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do you Import data from .txt files from folders within a folder?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-Import-data-from-txt-files-from-folders-within-a/m-p/457474#M79046</link>
      <description>&lt;P&gt;What are the props.conf settings for that sourcetype?  Are the files consistent in how timestamps are placed and formatted?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2019 20:02:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-Import-data-from-txt-files-from-folders-within-a/m-p/457474#M79046</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-03-27T20:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do you Import data from .txt files from folders within a folder?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-Import-data-from-txt-files-from-folders-within-a/m-p/457475#M79047</link>
      <description>&lt;P&gt;Here's how Splunk assigns timestamps to events (&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.4/Data/HowSplunkextractstimestamps" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.4/Data/HowSplunkextractstimestamps&lt;/A&gt;)&lt;/P&gt;

&lt;P&gt;Splunk software uses the following precedence rules to assign timestamps to events: &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;It looks for a time or date in the event itself using an explicit TIME_FORMAT, if provided. You configure the TIME_FORMAT attribute in props.conf.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;If no TIME_FORMAT was configured for the data, Splunk software attempts to automatically identify a time or date in the event itself. It uses the source type of the event (which includes TIME_FORMAT information) to try to find the timestamp.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;If an event has a time and date, but not a year, Splunk software determines the year, as described in How Splunk software determines timestamps with no year, and builds the timestamp from that.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;If no events in a source have a date, Splunk software tries to find a date in the source name or file name. Time of day is not identified in filenames. (This requires that the events have a time, even though they don't have a date.) &lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;For file sources, if no date can be identified in the file name, Splunk software uses the file modification time.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;As a last resort, Splunk software sets the timestamp to the current system time when indexing each event.&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;It sounds like you need to configure a props.conf for the sourcetypes to extract or assign the timestamp:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.5/admin/Propsconf#Timestamp_extraction_configuration" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.5/admin/Propsconf#Timestamp_extraction_configuration&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:53:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-Import-data-from-txt-files-from-folders-within-a/m-p/457475#M79047</guid>
      <dc:creator>solarboyz1</dc:creator>
      <dc:date>2020-09-29T23:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do you Import data from .txt files from folders within a folder?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-Import-data-from-txt-files-from-folders-within-a/m-p/457476#M79048</link>
      <description>&lt;P&gt;Hi  richgalloway,&lt;/P&gt;

&lt;P&gt;I think i didn't stressed enough the idea:&lt;/P&gt;

&lt;P&gt;Splunk get some time stamps from .txt file's Modified field from properties, other time stamps are get from i don't know where, because that time stamp is out of range when that file was created and written in.&lt;/P&gt;

&lt;P&gt;Hope this clarifies a bit my dilema.&lt;/P&gt;

&lt;P&gt;Thank you,&lt;/P&gt;

&lt;P&gt;Bogdan.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 09:07:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-Import-data-from-txt-files-from-folders-within-a/m-p/457476#M79048</guid>
      <dc:creator>bogdan_nicolesc</dc:creator>
      <dc:date>2019-03-28T09:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do you Import data from .txt files from folders within a folder?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-Import-data-from-txt-files-from-folders-within-a/m-p/457477#M79049</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;It seems that because in some .txt files i have added date, and in some i didn't, those without date are getting "calculated" date.&lt;/P&gt;

&lt;P&gt;I have to test my theory before i can conclude this.&lt;/P&gt;

&lt;P&gt;Thank you all.&lt;/P&gt;

&lt;P&gt;Bogdan.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 11:40:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-Import-data-from-txt-files-from-folders-within-a/m-p/457477#M79049</guid>
      <dc:creator>bogdan_nicolesc</dc:creator>
      <dc:date>2019-03-28T11:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do you Import data from .txt files from folders within a folder?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-Import-data-from-txt-files-from-folders-within-a/m-p/457478#M79050</link>
      <description>&lt;P&gt;Hi richgalloway,&lt;/P&gt;

&lt;P&gt;The problem is that i don't have props.conf if you are saying about: C:\Program Files\Splunk\etc\system\local.&lt;/P&gt;

&lt;P&gt;is there any location i can look for props.conf?&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;

&lt;P&gt;Bogdan&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 12:29:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-Import-data-from-txt-files-from-folders-within-a/m-p/457478#M79050</guid>
      <dc:creator>bogdan_nicolesc</dc:creator>
      <dc:date>2019-03-29T12:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do you Import data from .txt files from folders within a folder?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-Import-data-from-txt-files-from-folders-within-a/m-p/457479#M79051</link>
      <description>&lt;P&gt;Hi solarboyz1,&lt;/P&gt;

&lt;P&gt;If you are referring about props.conf from C:\Program Files\Splunk\etc\system\local, i don't have any file there.&lt;/P&gt;

&lt;P&gt;Other than that, how can i force Splunk to look for moddified field from properties?&lt;/P&gt;

&lt;P&gt;Thank you,&lt;/P&gt;

&lt;P&gt;Bogdan.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 12:32:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-Import-data-from-txt-files-from-folders-within-a/m-p/457479#M79051</guid>
      <dc:creator>bogdan_nicolesc</dc:creator>
      <dc:date>2019-03-29T12:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do you Import data from .txt files from folders within a folder?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-Import-data-from-txt-files-from-folders-within-a/m-p/457480#M79052</link>
      <description>&lt;P&gt;The only way to force splunk to do something, is to configure it that way.&lt;/P&gt;

&lt;P&gt;You will need to create a props.conf that defines how to extract the timestamps from the events. &lt;/P&gt;

&lt;P&gt;If you have a multi-server implementation, I recommend creating an app which is just a folder structure:&lt;BR /&gt;&lt;BR /&gt;
C:\Program Files\Splunk\etc\apps\MyApp\&lt;/P&gt;

&lt;P&gt;In that app, create your props.conf:&lt;BR /&gt;
C:\Program Files\Splunk\etc\apps\MyApp\local\props.conf&lt;/P&gt;

&lt;P&gt;In that props.conf you will then need to define how you want Splunk to extract the timestamp:&lt;/P&gt;

&lt;P&gt;[your_sourcetype]&lt;BR /&gt;
TIME_PREFIX = ^&lt;BR /&gt;
TIME_FORMAT = %Y-%m-%dT%H:%M:%S%z&lt;BR /&gt;
MAX_TIMESTAMP_LOOKAHEAD = 21&lt;BR /&gt;
SHOULD_LINEMERGE = false&lt;/P&gt;

&lt;P&gt;I recommend pushing that app to the forwarder monitoring the file, and your indexers. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:50:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-Import-data-from-txt-files-from-folders-within-a/m-p/457480#M79052</guid>
      <dc:creator>solarboyz1</dc:creator>
      <dc:date>2020-09-29T23:50:20Z</dc:date>
    </item>
  </channel>
</rss>

