<?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: JSON timestamps not parsed via HTTP Event Collector in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/JSON-timestamps-not-parsed-via-HTTP-Event-Collector/m-p/204690#M40394</link>
    <description>&lt;P&gt;I switched to using the Splunk-provided generic_single_line source type, and that doesn't work either. I am testing by POSTing to the collector, which has no TIME_PREFIX, and only posting the timestamp itself. It appears that I can only set the time via the "time" property on the enclosing JSON itself as detailed here: &lt;A href="http://dev.splunk.com/view/SP-CAAAE6P" target="_blank"&gt;http://dev.splunk.com/view/SP-CAAAE6P&lt;/A&gt;. Is that true?&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 09:56:16 GMT</pubDate>
    <dc:creator>bradserbuddy</dc:creator>
    <dc:date>2020-09-29T09:56:16Z</dc:date>
    <item>
      <title>JSON timestamps not parsed via HTTP Event Collector</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/JSON-timestamps-not-parsed-via-HTTP-Event-Collector/m-p/204689#M40393</link>
      <description>&lt;P&gt;Here are some of the values I am using for my JSON source type:&lt;/P&gt;

&lt;P&gt;MAX_TIMESTAMP_LOOKAHEAD = 1000 (as we have long JSON input)&lt;BR /&gt;
TIME_FORMAT = %FT%T.%3Q&lt;BR /&gt;
TIME_PREFIX = Timestamp\"\s:\s\"&lt;/P&gt;

&lt;P&gt;I've successfully imported the JSON from a file with the above source type values, but, for some reason, when coming in through my HTTP Event Collector, the timestamp isn't picked up (that is, _time is not set to the timestamp).&lt;/P&gt;

&lt;P&gt;I've restarted the server, tried different values for TIME_PREFIX (for instance not encoding the quotes, and dropping the \s regex) and TIME_FORMAT (for instance %Y-%m-%dT%H:%M:%S), and removed the KV_MODE=json to no avail.&lt;/P&gt;

&lt;P&gt;Am I misunderstanding the relationship between timestamp parsing and _time? Is there something else I need to do to get my source type to work with my HTTP Event Collector? Are there additional troubleshooting steps/tools I can use to help track down what's going on?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Brad&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:55:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/JSON-timestamps-not-parsed-via-HTTP-Event-Collector/m-p/204689#M40393</guid>
      <dc:creator>bradserbuddy</dc:creator>
      <dc:date>2020-09-29T09:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: JSON timestamps not parsed via HTTP Event Collector</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/JSON-timestamps-not-parsed-via-HTTP-Event-Collector/m-p/204690#M40394</link>
      <description>&lt;P&gt;I switched to using the Splunk-provided generic_single_line source type, and that doesn't work either. I am testing by POSTing to the collector, which has no TIME_PREFIX, and only posting the timestamp itself. It appears that I can only set the time via the "time" property on the enclosing JSON itself as detailed here: &lt;A href="http://dev.splunk.com/view/SP-CAAAE6P" target="_blank"&gt;http://dev.splunk.com/view/SP-CAAAE6P&lt;/A&gt;. Is that true?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:56:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/JSON-timestamps-not-parsed-via-HTTP-Event-Collector/m-p/204690#M40394</guid>
      <dc:creator>bradserbuddy</dc:creator>
      <dc:date>2020-09-29T09:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: JSON timestamps not parsed via HTTP Event Collector</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/JSON-timestamps-not-parsed-via-HTTP-Event-Collector/m-p/204691#M40395</link>
      <description>&lt;P&gt;Our JSON endpoint for HTTP Event Collector does not do timestamp extraction. Our JSON endpoint expects events sent using a lightweight structure, our &lt;A href="http://dev.splunk.com/view/event-collector/SP-CAAAE6P"&gt;JSON Event Protocol&lt;/A&gt;. The plus side is your "event" payload can be any JSON (or not) / can have whitespace, newlines, etc and it will still come as a single event. For example you could also have a Java stack trace and it will easily go in as a single event. For the timestamp,  you have to specify "time" explicitly outside the payload in the event envelope in epoch format i.e.&lt;/P&gt;

&lt;P&gt;{&lt;BR /&gt;
    "time": 1426279439, &lt;BR /&gt;
    "host": "localhost",&lt;BR /&gt;
    "source": "datasource",&lt;BR /&gt;
    "sourcetype": "txt",&lt;BR /&gt;
    "index": "main",&lt;BR /&gt;
    "event": { "hello": "world" }&lt;BR /&gt;
}&lt;/P&gt;

&lt;P&gt;In Splunk Cloud / Splunk 6.4 you have a different option, our new &lt;A href="http://dev.splunk.com/view/event-collector/SP-CAAAE8Y"&gt;raw endpoint&lt;/A&gt;. With raw you can send an arbitrary payload to HEC (/services/collector/raw) and we will honor breaking rules and do timestamp extraction. It should I believe meet your need.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jun 2016 18:42:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/JSON-timestamps-not-parsed-via-HTTP-Event-Collector/m-p/204691#M40395</guid>
      <dc:creator>gblock_splunk</dc:creator>
      <dc:date>2016-06-12T18:42:19Z</dc:date>
    </item>
  </channel>
</rss>

