<?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 Specify a timestamp field from indexed RESTful JSON in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Specify-a-timestamp-field-from-indexed-RESTful-JSON/m-p/190244#M37888</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am using the REST Modular Input to query some RESTful services. I am having trouble defining the timestamp for this data. It seems that the _time field is being populated with the periodic query time, rather than from the input JSON. I have a sample of the JSON below, and in this case, I want to use the "startTime" field as the event timestamp.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"id":"7cf85251-d8e0-11e4-9181-0050568e590c","businessKey":"17032015-3AEA-4069-A2DD-SSSS00000006","processDefinitionId":"b8777c40-d832-11e4-968b-0050568e590c","startTime":"2015-04-02T13:32:20","endTime":"2015-04-02T13:44:37","durationInMillis":737088,"startUserId":null,"startActivityId":"EAID_38D5905A_8B84_4c4a_92FD_34D66315F33C","deleteReason":null,"superProcessInstanceId":null,"caseInstanceId":null}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This data comes from a periodic query and so there's alot of duplication (which I eliminate at search time with "dedup id"). &lt;/P&gt;

&lt;P&gt;My inputs.conf for this input looks like;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[rest://my input name]
auth_type = none
endpoint = &lt;A href="http://{server}:{port}/path/to/service" target="test_blank"&gt;http://{server}:{port}/path/to/service&lt;/A&gt;
http_method = GET
index_error_response_codes = 0
polling_interval = 120
response_type = json
sourcetype = _json
streaming_request = 0
index = my_index
TIME_PREFIX = "startTime"
MAX_TIMESTAMP_LOOKAHEAD = 200 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Neither of the final 2 settings seem to affect the appended timestamp, and my log is showing errors for this data input;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;05-19-2015 08:47:43.870 +1000 WARN  DateParserVerbose - Failed to parse timestamp. Defaulting to timestamp of previous event (Wed Apr 15 00:04:44 2015). Context: source::rest://my input name|host::{server}|_json|245739566646
05-19-2015 08:49:44.164 +1000 WARN  DateParserVerbose - A possible timestamp match (Tue Jan 06 19:40:31 2009) is outside of the acceptable time window. If this timestamp is correct, consider adjusting MAX_DAYS_AGO and MAX_DAYS_HENCE. Context: source::rest://my inpout name|host::{server}|_json|245739566646
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I guess it's picking up some other substring (besides the "startTime" value) and failing to parse that, so defaulting back to the query time.&lt;/P&gt;

&lt;P&gt;Any ideas on how to solve this issue?&lt;/P&gt;

&lt;P&gt;NOTE: This is a 3rd party system I am querying, so I can't manipulate the response JSON.&lt;/P&gt;</description>
    <pubDate>Mon, 18 May 2015 22:53:06 GMT</pubDate>
    <dc:creator>rjlohan</dc:creator>
    <dc:date>2015-05-18T22:53:06Z</dc:date>
    <item>
      <title>Specify a timestamp field from indexed RESTful JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Specify-a-timestamp-field-from-indexed-RESTful-JSON/m-p/190244#M37888</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am using the REST Modular Input to query some RESTful services. I am having trouble defining the timestamp for this data. It seems that the _time field is being populated with the periodic query time, rather than from the input JSON. I have a sample of the JSON below, and in this case, I want to use the "startTime" field as the event timestamp.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"id":"7cf85251-d8e0-11e4-9181-0050568e590c","businessKey":"17032015-3AEA-4069-A2DD-SSSS00000006","processDefinitionId":"b8777c40-d832-11e4-968b-0050568e590c","startTime":"2015-04-02T13:32:20","endTime":"2015-04-02T13:44:37","durationInMillis":737088,"startUserId":null,"startActivityId":"EAID_38D5905A_8B84_4c4a_92FD_34D66315F33C","deleteReason":null,"superProcessInstanceId":null,"caseInstanceId":null}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This data comes from a periodic query and so there's alot of duplication (which I eliminate at search time with "dedup id"). &lt;/P&gt;

&lt;P&gt;My inputs.conf for this input looks like;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[rest://my input name]
auth_type = none
endpoint = &lt;A href="http://{server}:{port}/path/to/service" target="test_blank"&gt;http://{server}:{port}/path/to/service&lt;/A&gt;
http_method = GET
index_error_response_codes = 0
polling_interval = 120
response_type = json
sourcetype = _json
streaming_request = 0
index = my_index
TIME_PREFIX = "startTime"
MAX_TIMESTAMP_LOOKAHEAD = 200 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Neither of the final 2 settings seem to affect the appended timestamp, and my log is showing errors for this data input;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;05-19-2015 08:47:43.870 +1000 WARN  DateParserVerbose - Failed to parse timestamp. Defaulting to timestamp of previous event (Wed Apr 15 00:04:44 2015). Context: source::rest://my input name|host::{server}|_json|245739566646
05-19-2015 08:49:44.164 +1000 WARN  DateParserVerbose - A possible timestamp match (Tue Jan 06 19:40:31 2009) is outside of the acceptable time window. If this timestamp is correct, consider adjusting MAX_DAYS_AGO and MAX_DAYS_HENCE. Context: source::rest://my inpout name|host::{server}|_json|245739566646
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I guess it's picking up some other substring (besides the "startTime" value) and failing to parse that, so defaulting back to the query time.&lt;/P&gt;

&lt;P&gt;Any ideas on how to solve this issue?&lt;/P&gt;

&lt;P&gt;NOTE: This is a 3rd party system I am querying, so I can't manipulate the response JSON.&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 22:53:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Specify-a-timestamp-field-from-indexed-RESTful-JSON/m-p/190244#M37888</guid>
      <dc:creator>rjlohan</dc:creator>
      <dc:date>2015-05-18T22:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Specify a timestamp field from indexed RESTful JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Specify-a-timestamp-field-from-indexed-RESTful-JSON/m-p/190245#M37889</link>
      <description>&lt;P&gt;Well , you are not using TIME_PREFIX and MAX_TIMESTAMP_LOOKAHEAD correctly. These are parameters of props.conf , not inputs.conf.&lt;/P&gt;

&lt;P&gt;Example :&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;inputs.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[rest://my input name]
 auth_type = none
 endpoint = http://{server}:{port}/path/to/service
 http_method = GET
 index_error_response_codes = 0
 polling_interval = 120
 response_type = json
 sourcetype = my_sourcetype
 streaming_request = 0
 index = my_index
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_sourcetype]
TIME_PREFIX = startTime":"
MAX_TIMESTAMP_LOOKAHEAD = 200 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:55:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Specify-a-timestamp-field-from-indexed-RESTful-JSON/m-p/190245#M37889</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2020-09-28T19:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Specify a timestamp field from indexed RESTful JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Specify-a-timestamp-field-from-indexed-RESTful-JSON/m-p/190246#M37890</link>
      <description>&lt;P&gt;Thanks again Damien, I missed that completely. Still getting my head around Splunk! This change seems to work.&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 22:51:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Specify-a-timestamp-field-from-indexed-RESTful-JSON/m-p/190246#M37890</guid>
      <dc:creator>rjlohan</dc:creator>
      <dc:date>2015-05-19T22:51:46Z</dc:date>
    </item>
  </channel>
</rss>

