<?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: Time Extraction for HTTP Event Collector JSON logs in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-do-time-extraction-for-HTTP-Event-Collector-JSON-logs/m-p/597413#M104305</link>
    <description>&lt;P&gt;Is your syslog forwarder a universal forwarder or a heavy forwarder (Splunk Enterprise instance acting as forwarder)?&lt;/P&gt;&lt;P&gt;Also, make sure you're using this as TIME_FORMAT (%H instead of %h for hour).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;TIME_FORMAT = %Y-%m-%d %H:%M:%S%Z&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 11 May 2022 14:19:26 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2022-05-11T14:19:26Z</dc:date>
    <item>
      <title>How to do time extraction for HTTP Event Collector JSON logs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-do-time-extraction-for-HTTP-Event-Collector-JSON-logs/m-p/597227#M104256</link>
      <description>&lt;P&gt;I have an HTTP Event Collector input collecting JSON data via syslog forwarder. The syslog-ng message looks like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;body("{ \"source\": \"${.splunk.source}\",
        \"event\":  ${MSG}
}")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can see the message and the proper source in my indexer. But time extraction is the problem. Because there is often a delay between the log and the time syslog receives it, I want to use a field in the message to grab the timestamp... A message looks like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{"data":"stuff","time_stamp":"2022-05-10 17:14:23Z","value1":"more_stuff"}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, I create a props.conf on my indexer cluster that looks like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[my_sourcetype]
DATETIME_CONFIG =
MAX_TIMESTAMP_LOOKAHEAD = 30
TIME_PREFIX = time_stamp\":\"
TIME_FORMAT = %Y-%m-%d %h:%M:%S%Z
TZ = UTC&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've confirmed the sourcetype is correct as I define it in the inputs for HEC and they match. But for the life of me, I can't seem to get Splunk to find the time. I've tried looking for errors using this search:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index = _internal log_level = WARN OR log_level =ERROR  "timestamp"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(found in an older community post, so thanks to the author) but I find nothing. I tried playing in the UI and creating a new data type (the add new data widget). In that UI, my props.conf should work. But for some reason on the cluster it doesnt.&lt;/P&gt;
&lt;P&gt;Are there any other troubleshooting steps I can follow? Am I missing something that might help this work better?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 22:44:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-do-time-extraction-for-HTTP-Event-Collector-JSON-logs/m-p/597227#M104256</guid>
      <dc:creator>scottsavareseat</dc:creator>
      <dc:date>2022-05-11T22:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Time Extraction for HTTP Event Collector JSON logs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-do-time-extraction-for-HTTP-Event-Collector-JSON-logs/m-p/597413#M104305</link>
      <description>&lt;P&gt;Is your syslog forwarder a universal forwarder or a heavy forwarder (Splunk Enterprise instance acting as forwarder)?&lt;/P&gt;&lt;P&gt;Also, make sure you're using this as TIME_FORMAT (%H instead of %h for hour).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;TIME_FORMAT = %Y-%m-%d %H:%M:%S%Z&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 11 May 2022 14:19:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-do-time-extraction-for-HTTP-Event-Collector-JSON-logs/m-p/597413#M104305</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2022-05-11T14:19:26Z</dc:date>
    </item>
  </channel>
</rss>

