<?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 recognization for HEC input in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/timestamp-recognization-for-HEC-input/m-p/478925#M99812</link>
    <description>&lt;P&gt;I'm trying to ingest HEC input into Splunk and set up correct props.conf as below but timestamp is not getting extracted correctly (mainly milliseconds are not matching with index times). &lt;/P&gt;

&lt;P&gt;[iks-log4j]&lt;BR /&gt;
TIME_PREFIX=^&lt;BR /&gt;
TIME_FORMAT= %Y-%m-%dT%H:%M:%S,%3N&lt;BR /&gt;
MAX_TIMESTAMP_LOOKAHEAD=23&lt;BR /&gt;
SHOULD_LINEMERGE=false&lt;/P&gt;

&lt;H1&gt;LINE_BREAKER=([\r\n]+)&lt;/H1&gt;

&lt;P&gt;TRUNCATE=999999&lt;/P&gt;

&lt;P&gt;Here is the sample event raw data:&lt;BR /&gt;
2019-09-16T17:54:39,928 10647234 | INFO | XXXXXXXXXXXXXXXXXX&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 02:52:47 GMT</pubDate>
    <dc:creator>mchang_splunk</dc:creator>
    <dc:date>2020-09-30T02:52:47Z</dc:date>
    <item>
      <title>timestamp recognization for HEC input</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/timestamp-recognization-for-HEC-input/m-p/478925#M99812</link>
      <description>&lt;P&gt;I'm trying to ingest HEC input into Splunk and set up correct props.conf as below but timestamp is not getting extracted correctly (mainly milliseconds are not matching with index times). &lt;/P&gt;

&lt;P&gt;[iks-log4j]&lt;BR /&gt;
TIME_PREFIX=^&lt;BR /&gt;
TIME_FORMAT= %Y-%m-%dT%H:%M:%S,%3N&lt;BR /&gt;
MAX_TIMESTAMP_LOOKAHEAD=23&lt;BR /&gt;
SHOULD_LINEMERGE=false&lt;/P&gt;

&lt;H1&gt;LINE_BREAKER=([\r\n]+)&lt;/H1&gt;

&lt;P&gt;TRUNCATE=999999&lt;/P&gt;

&lt;P&gt;Here is the sample event raw data:&lt;BR /&gt;
2019-09-16T17:54:39,928 10647234 | INFO | XXXXXXXXXXXXXXXXXX&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:52:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/timestamp-recognization-for-HEC-input/m-p/478925#M99812</guid>
      <dc:creator>mchang_splunk</dc:creator>
      <dc:date>2020-09-30T02:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: timestamp recognization for HEC input</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/timestamp-recognization-for-HEC-input/m-p/478926#M99813</link>
      <description>&lt;P&gt;HEC will only extract timestamp from "Time" with epoch time as mentioned in the document:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Data/FormateventsforHTTPEventCollector#Event_metadata"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Data/FormateventsforHTTPEventCollector#Event_metadata&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;For example, you must give the field name "time", otherwise, Splunk will use current time as timestamp:&lt;BR /&gt;
curl -k "https://:8088/services/collector" -H "Authorization: Splunk " -d '{"host": "test", "index": "main", "sourcetype": "iks-log4j", "event": "2019-09-16T17:54:39,928 whatever.....", "time": 1568656479928}'&lt;/P&gt;

&lt;P&gt;Or you can use raw event parsing:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Data/FormateventsforHTTPEventCollector#Raw_event_parsing"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Data/FormateventsforHTTPEventCollector#Raw_event_parsing&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;For example, the timestamp will be extracted from the time in "event":&lt;/P&gt;

&lt;P&gt;curl &lt;A href="https://:8088/services/collector/raw?channel=" target="test_blank"&gt;https://:8088/services/collector/raw?channel=&lt;/A&gt; -H "Authorization: Splunk " -d '{"host": "test", "index": "main", "sourcetype": "iks-log4j", "data": {"event": "2019-09-16T17:54:39,928 whatever....."}'&lt;/P&gt;

&lt;P&gt;So EITHER add "time" in event metadata OR use raw event parsing should be able to resolve this issue.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 20:23:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/timestamp-recognization-for-HEC-input/m-p/478926#M99813</guid>
      <dc:creator>mchang_splunk</dc:creator>
      <dc:date>2019-11-05T20:23:59Z</dc:date>
    </item>
  </channel>
</rss>

