<?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 force Splunk use epoch time in the log file as index time in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-force-Splunk-use-epoch-time-in-the-log-file-as-index-time/m-p/273472#M52477</link>
    <description>&lt;P&gt;Was this change made on the UF sending the data or the indexer? Indexed extractions have to be where the data is ingested, so if it's a UF then the props have to be there.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Dec 2016 17:21:41 GMT</pubDate>
    <dc:creator>beatus</dc:creator>
    <dc:date>2016-12-14T17:21:41Z</dc:date>
    <item>
      <title>How to force Splunk use epoch time in the log file as index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-force-Splunk-use-epoch-time-in-the-log-file-as-index-time/m-p/273469#M52474</link>
      <description>&lt;P&gt;I have following logs from a customer device:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;0080101c40ba,10.10.1.2,1481421584,host1.labtest.com,error-message1,sev1
0080101c4114,10.33.1.3,1481421595,host2.labtest.com,error-message2,sev2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[csv]
FIELD_DELIMITER = ,
FIELD_NAMES = transactionId, hostIp, time, fqdn, MsgType, Severity
TIME_PREFIX = ^(?:[^,]*,){2}
MAX_TIMESTAMP_LOOKAHEAD = 10
TIME_FORMAT = %s

SHOULD_LINEMERGE = False
pulldown_type = 1
REPORT-getfields = testlog_fields
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[testlog_fields]
DELIMS=","
FIELDS = "transactionId", "hostIp", "time", "fqdn", "MsgType", "Severity"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The log files I received have incorrect timestamp on it, meaning not the time when the logs were generated.  After ingested the logs, I noticed Splunk is using the log ingest time for index time (as shown in _time).  Is there anyway to force Splunk use the epoch time inside the logs as Index time so that I can search for "last 7 days", "last month" event?&lt;/P&gt;

&lt;P&gt;Thanks &lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 15:18:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-force-Splunk-use-epoch-time-in-the-log-file-as-index-time/m-p/273469#M52474</guid>
      <dc:creator>jgcsco</dc:creator>
      <dc:date>2016-12-14T15:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to force Splunk use epoch time in the log file as index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-force-Splunk-use-epoch-time-in-the-log-file-as-index-time/m-p/273470#M52475</link>
      <description>&lt;P&gt;jgcsco,&lt;BR /&gt;
It looks like the "csv" sourcetype utilizes "INDEXED_EXTRACTIONS" by default. This causes much of the props work to happen at the very first splunk instance the data hits, including Universal forwarders. If that's the case, you'd want to put your props there and utilize a few other config settings. Namely:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;[csv]&lt;BR /&gt;
FIELD_DELIMITER = ,&lt;BR /&gt;
FIELD_NAMES = transactionId, hostIp, time, fqdn, MsgType, Severity&lt;BR /&gt;
MAX_TIMESTAMP_LOOKAHEAD = 10&lt;BR /&gt;
TIME_FORMAT = %s&lt;BR /&gt;
TIMESTAMP_FIELDS = time&lt;BR /&gt;
INDEXED_EXTRACTIONS = csv&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Note the "TIMESTAMP_FIELDS" and "INDEXED_EXTRACTIONS". I'm setting "INDEXED_EXTRACTIONS" to be verbose and avoid confusion in the future. Additionally you do not need a timeprefix as you're specifying the specific field for Splunk to look at for a time stamp.&lt;/P&gt;

&lt;P&gt;You can check with btool what's being set on your sourcetype:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;splunk btool props list csv --debug&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;This will show all the props settings for that stanza and where they're set.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:05:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-force-Splunk-use-epoch-time-in-the-log-file-as-index-time/m-p/273470#M52475</guid>
      <dc:creator>beatus</dc:creator>
      <dc:date>2020-09-29T12:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to force Splunk use epoch time in the log file as index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-force-Splunk-use-epoch-time-in-the-log-file-as-index-time/m-p/273471#M52476</link>
      <description>&lt;P&gt;I added the following two line to props.conf&lt;/P&gt;

&lt;P&gt;TIMESTAMP_FIELDS = time&lt;BR /&gt;
INDEXED_EXTRACTIONS = csv&lt;/P&gt;

&lt;P&gt;And here is the output:&lt;BR /&gt;
/opt/splunk/etc/apps/search/local# /opt/splunk/bin/splunk btool props list csv --debug&lt;BR /&gt;
/opt/splunk/etc/apps/search/local/props.conf [csv]&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    ANNOTATE_PUNCT = True&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    AUTO_KV_JSON = true&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    BREAK_ONLY_BEFORE =&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    BREAK_ONLY_BEFORE_DATE = True&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    CHARSET = UTF-8&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    DATETIME_CONFIG = /etc/datetime.xml&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    HEADER_MODE =&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    INDEXED_EXTRACTIONS = csv&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    KV_MODE = none&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    LEARN_MODEL = true&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    LEARN_SOURCETYPE = true&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    LINE_BREAKER_LOOKBEHIND = 100&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    MAX_DAYS_AGO = 2000&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    MAX_DAYS_HENCE = 2&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    MAX_DIFF_SECS_AGO = 3600&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    MAX_DIFF_SECS_HENCE = 604800&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    MAX_EVENTS = 256&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    MAX_TIMESTAMP_LOOKAHEAD = 128&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    MUST_BREAK_AFTER =&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    MUST_NOT_BREAK_AFTER =&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    MUST_NOT_BREAK_BEFORE =&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    SEGMENTATION = indexing&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    SEGMENTATION-all = full&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    SEGMENTATION-inner = inner&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    SEGMENTATION-outer = outer&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    SEGMENTATION-raw = none&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    SEGMENTATION-standard = standard&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    SHOULD_LINEMERGE = False&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    TRANSFORMS =&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    TRUNCATE = 10000&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    category = Structured&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    description = Comma-separated value format. Set header and other settings in "Delimited Settings"&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    detect_trailing_nulls = false&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    maxDist = 100&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    priority =&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    pulldown_type = true&lt;BR /&gt;
/opt/splunk/etc/system/default/props.conf    sourcetype =&lt;/P&gt;

&lt;P&gt;After restart Splunk, I am still not seeing the _time change to match the epoch time in the logs. Do I miss anything else?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:07:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-force-Splunk-use-epoch-time-in-the-log-file-as-index-time/m-p/273471#M52476</guid>
      <dc:creator>jgcsco</dc:creator>
      <dc:date>2020-09-29T12:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to force Splunk use epoch time in the log file as index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-force-Splunk-use-epoch-time-in-the-log-file-as-index-time/m-p/273472#M52477</link>
      <description>&lt;P&gt;Was this change made on the UF sending the data or the indexer? Indexed extractions have to be where the data is ingested, so if it's a UF then the props have to be there.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 17:21:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-force-Splunk-use-epoch-time-in-the-log-file-as-index-time/m-p/273472#M52477</guid>
      <dc:creator>beatus</dc:creator>
      <dc:date>2016-12-14T17:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to force Splunk use epoch time in the log file as index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-force-Splunk-use-epoch-time-in-the-log-file-as-index-time/m-p/273473#M52478</link>
      <description>&lt;P&gt;This is a single node environment. The log files in on the directory on the splunk node. &lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 18:51:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-force-Splunk-use-epoch-time-in-the-log-file-as-index-time/m-p/273473#M52478</guid>
      <dc:creator>jgcsco</dc:creator>
      <dc:date>2016-12-14T18:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to force Splunk use epoch time in the log file as index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-force-Splunk-use-epoch-time-in-the-log-file-as-index-time/m-p/273474#M52479</link>
      <description>&lt;P&gt;Is the time off by a set of hours, as in does it look like the timezone is wrong but the minutes and seconds are correct?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 18:57:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-force-Splunk-use-epoch-time-in-the-log-file-as-index-time/m-p/273474#M52479</guid>
      <dc:creator>beatus</dc:creator>
      <dc:date>2016-12-14T18:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to force Splunk use epoch time in the log file as index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-force-Splunk-use-epoch-time-in-the-log-file-as-index-time/m-p/273475#M52480</link>
      <description>&lt;P&gt;The time shows up in Splunk is the time the log being ingested. e.g there are over 100 log files ingested yesterday which have logged event information for the last two weeks.  I am looking for if there is a way to have Splunk can use the epoch time associated with each event in inside the log files as "_time". &lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 19:03:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-force-Splunk-use-epoch-time-in-the-log-file-as-index-time/m-p/273475#M52480</guid>
      <dc:creator>jgcsco</dc:creator>
      <dc:date>2016-12-14T19:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to force Splunk use epoch time in the log file as index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-force-Splunk-use-epoch-time-in-the-log-file-as-index-time/m-p/273476#M52481</link>
      <description>&lt;P&gt;Time is an index time operation, so modifying these settings won't change what's already in Splunk. Have you tested on new data after modifying the settings?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 19:13:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-force-Splunk-use-epoch-time-in-the-log-file-as-index-time/m-p/273476#M52481</guid>
      <dc:creator>beatus</dc:creator>
      <dc:date>2016-12-14T19:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to force Splunk use epoch time in the log file as index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-force-Splunk-use-epoch-time-in-the-log-file-as-index-time/m-p/273477#M52482</link>
      <description>&lt;P&gt;thanks for pointing it out. It is working now! Thanks a lot for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 21:17:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-force-Splunk-use-epoch-time-in-the-log-file-as-index-time/m-p/273477#M52482</guid>
      <dc:creator>jgcsco</dc:creator>
      <dc:date>2016-12-14T21:17:33Z</dc:date>
    </item>
  </channel>
</rss>

