<?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: Need help extracting timestamp from unstructured data (JSON) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-help-extracting-timestamp-from-unstructured-data-JSON/m-p/371729#M109372</link>
    <description>&lt;P&gt;On Indexer/HeavyForwarder, props.conf (event breaking and timestamp parsing configuration)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[YourSourceType]
SHOULD_LINEMERGE = false
LINE_BREAKER =([\r\n]+)(?=\{\"time\")
TIME_PREFIX = ^\{\"time\"\:
TIME_FORMAT = %Y-%m-%d %H:%M:%S.%3N %:z
MAX_TIMESTAMP_LOOKAHEAD = 30
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;On Search Head, props.conf (field extraction configuration)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[YourSourceType]
KV_MODE = json
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 03 Jan 2018 19:42:52 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-01-03T19:42:52Z</dc:date>
    <item>
      <title>Need help extracting timestamp from unstructured data (JSON)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-extracting-timestamp-from-unstructured-data-JSON/m-p/371728#M109371</link>
      <description>&lt;P&gt;Need help to extract timestamp and structure data -&lt;/P&gt;

&lt;P&gt;{&lt;STRONG&gt;"time":"2017-12-12 16:25:27.418 +05:30"&lt;/STRONG&gt;, "severity":"INFORMATION", "_tag":"", "correlation_id":"null","Message":"[RequestController] RequestController - POST - api/request - [STARTS]", "client_id":"null", "instance_id":"null", "class_name_hierrarchy":"","method":"", "response_time":""} {&lt;STRONG&gt;"time":"2017-12-12 16:25:27.418 +05:30"&lt;/STRONG&gt;, "severity":"INFORMATION", "_tag":"", "correlation_id":"null","Message":"[EPCAdapter] - CreateRequest - Before Get OAuthToken - ", "client_id":"null", "instance_id":"null", "class_name_hierrarchy":"","method":"", "response_time":""} {&lt;STRONG&gt;"time":"2017-12-12 16:25:27.418 +05:30"&lt;/STRONG&gt;, "severity":"INFORMATION", "_tag":"", "correlation_id":"null","Message":"[HttpCommunicationHelper] In Execute Request Method", "client_id":"null", "instance_id":"null", "class_name_hierrarchy":"","method":"", "response_time":""} {&lt;STRONG&gt;"time":"2017-12-12 16:25:27.418 +05:30"&lt;/STRONG&gt;, "severity":"INFORMATION", "_tag":"", "correlation_id":"null","Message":"[HttpCommunicationHelper] Request Type is POST", "client_id":"null", "instance_id":"null", "class_name_hierrarchy":"","method":"", "response_time":""} {&lt;STRONG&gt;"time":"2017-12-12 16:25:27.418 +05:30"&lt;/STRONG&gt;, "severity":"INFORMATION", "_tag":"", "correlation_id":"null","Message":"[HttpCommunicationHelper] Request Base URL is &lt;A href="https://int.api.ellielabs.com/" target="_blank"&gt;https://int.api.ellielabs.com/&lt;/A&gt;", "client_id":"null", "instance_id":"null", "class_name_hierrarchy":"","method":"", "response_time":""} &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:28:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-extracting-timestamp-from-unstructured-data-JSON/m-p/371728#M109371</guid>
      <dc:creator>nmohammed</dc:creator>
      <dc:date>2020-09-29T17:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need help extracting timestamp from unstructured data (JSON)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-extracting-timestamp-from-unstructured-data-JSON/m-p/371729#M109372</link>
      <description>&lt;P&gt;On Indexer/HeavyForwarder, props.conf (event breaking and timestamp parsing configuration)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[YourSourceType]
SHOULD_LINEMERGE = false
LINE_BREAKER =([\r\n]+)(?=\{\"time\")
TIME_PREFIX = ^\{\"time\"\:
TIME_FORMAT = %Y-%m-%d %H:%M:%S.%3N %:z
MAX_TIMESTAMP_LOOKAHEAD = 30
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;On Search Head, props.conf (field extraction configuration)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[YourSourceType]
KV_MODE = json
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jan 2018 19:42:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-extracting-timestamp-from-unstructured-data-JSON/m-p/371729#M109372</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-01-03T19:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: Need help extracting timestamp from unstructured data (JSON)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-extracting-timestamp-from-unstructured-data-JSON/m-p/371730#M109373</link>
      <description>&lt;P&gt;This should work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[&amp;lt;sourcetype&amp;gt;]
SHOULD_LINEMERGE = FALSE
LINE_BREAKER = ([\s\n\r]+){"time":"
TIME_PREFIX = {"time":"
TIME_FORMAT = %Y-%m-%d %H:%M:%S.%3Q %:z
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above assumes that each event starts with &lt;CODE&gt;{"time"&lt;/CODE&gt;, and each instance of &lt;CODE&gt;{"time"&lt;/CODE&gt; starts an entirely new event.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2018 19:45:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-extracting-timestamp-from-unstructured-data-JSON/m-p/371730#M109373</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2018-01-03T19:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need help extracting timestamp from unstructured data (JSON)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-extracting-timestamp-from-unstructured-data-JSON/m-p/371731#M109374</link>
      <description>&lt;P&gt;You should input this file on a test machine somewhere using the Add Data wizard. The wizard will show you a preview of how the data will be parsed, and allow you to experiment with various props.conf settings, such as linebreaking and timestamping.&lt;/P&gt;

&lt;P&gt;For JSON inputs, you can use INDEXED_EXTRACTIONS if you want, or simply parse the file as plain text. &lt;BR /&gt;
INDEXED_EXTRACTIONS will consume more disk space and potentially lower the search performance, but it may be your best choice when the data format is variable.&lt;/P&gt;

&lt;P&gt;Option 1: no indexed extractions (recommended if it works) &lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetypehere]
TRUNCATE = 0
CHARSET = UTF-8
KV_MODE=JSON
SHOULD_LINEMERGE=true
BREAK_ONLY_BEFORE={"time":"
TIME_PREFIX={"time":"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Option 2: indexed extractions &lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetypehere]
TRUNCATE = 0
CHARSET = UTF-8
KV_MODE = none
INDEXED_EXTRACTIONS=JSON
TIMESTAMP_FIELDS = time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Finally, you may need to make sure that each new event starts on a new line in the log file.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:24:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-extracting-timestamp-from-unstructured-data-JSON/m-p/371731#M109374</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2020-09-29T17:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need help extracting timestamp from unstructured data (JSON)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-extracting-timestamp-from-unstructured-data-JSON/m-p/371732#M109375</link>
      <description>&lt;P&gt;Sorry for the later reply, while I was out for sometime. But this worked as expected.&lt;/P&gt;

&lt;P&gt;Thank you all for help.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 07:17:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-extracting-timestamp-from-unstructured-data-JSON/m-p/371732#M109375</guid>
      <dc:creator>nmohammed</dc:creator>
      <dc:date>2018-02-06T07:17:49Z</dc:date>
    </item>
  </channel>
</rss>

