<?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: Splunk UI: Some JSON Logs Not Being Parsed Correctly in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-UI-Some-JSON-Logs-Not-Being-Parsed-Correctly/m-p/398373#M71033</link>
    <description>&lt;P&gt;@kahlerb, based on the sample data provided spath works just fine on the second JSON data. Following is a run anywhere example for you to test.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw=" {
     \"tags\": {
         \"client_id\": \"12312312312\",
         \"req_id\": \"79879879879879\"
     },
     \"timestamp\": \"2018-05-08T23:59:58Z\",
     \"application\": \"MY APPLICATION\",
     \"env\": \"development\",
     \"log_level\": \"INFO\",
     \"message\": \"Completed 200 OK in 21ms (Views: 8.0ms | ActiveRecord: 5.8ms)\"
 }"
 | spath
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 15 May 2018 04:02:01 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2018-05-15T04:02:01Z</dc:date>
    <item>
      <title>Splunk UI: Some JSON Logs Not Being Parsed Correctly</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-UI-Some-JSON-Logs-Not-Being-Parsed-Correctly/m-p/398371#M71031</link>
      <description>&lt;P&gt;I recently introduced some new fields to my boilerplate logging strategy. After this introduction, Splunk's UI is not parsing the majority of my logs as json, and instead grouping several json objects together. The only addition I have made was to add &lt;CODE&gt;client_id&lt;/CODE&gt; as a nested key under &lt;CODE&gt;tags&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Here is an example of a log that is parsed correctly in the Splunk UI:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
    "tags": {
        "client_id": null,
        "req_id": "12312312312asdfasdfas"
    },
    "timestamp": "2018-05-08T23:59:54Z",
    "application": "MY APPLICATION",
    "env": "development",
    "log_level": "INFO",
    "message": "Processing by HealthCheckController#index as */*"
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is an example of a log that is &lt;STRONG&gt;not&lt;/STRONG&gt; parsed correctly in the Splunk UI:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
    "tags": {
        "client_id": "12312312312",
        "req_id": "79879879879879"
    },
    "timestamp": "2018-05-08T23:59:58Z",
    "application": "MY APPLICATION",
    "env": "development",
    "log_level": "INFO",
    "message": "Completed 200 OK in 21ms (Views: 8.0ms | ActiveRecord: 5.8ms)"
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Both are valid json. It seems that anywhere &lt;CODE&gt;tags.client_id&lt;/CODE&gt; is not null, the log is not being parsed correctly and instead being grouped with several other logs. Though even that does not hold true 100% of the time.&lt;/P&gt;

&lt;P&gt;What might cause Splunk to fail to parse some valid json logs, but not others ?&lt;BR /&gt;
Does the timing of the logs have anything to do with it  (Some of my logs come in bursts) ?&lt;BR /&gt;
The grouping of some of the logs, is also impacting search queries.&lt;/P&gt;</description>
      <pubDate>Tue, 15 May 2018 00:35:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-UI-Some-JSON-Logs-Not-Being-Parsed-Correctly/m-p/398371#M71031</guid>
      <dc:creator>kahlerb</dc:creator>
      <dc:date>2018-05-15T00:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk UI: Some JSON Logs Not Being Parsed Correctly</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-UI-Some-JSON-Logs-Not-Being-Parsed-Correctly/m-p/398372#M71032</link>
      <description>&lt;P&gt;Hi kahlerb,&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;client_id&lt;/CODE&gt; suspiciously looks like an epoch timestamp and therefore Splunk thinks it is one. Configure a &lt;CODE&gt;props.conf&lt;/CODE&gt; on the parsing Splunk instance for the sourcetype and use the &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; option like this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_PREFIX="timestamp": "
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You might also need to adjust the &lt;CODE&gt;MAX_TIMESTAMP_LOOKAHEAD&lt;/CODE&gt; to get that far into the event, and &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt; to help Splunk to understand what format your time stamp has.&lt;BR /&gt;
See the docs &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Admin/Propsconf#Timestamp_extraction_configuration"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Admin/Propsconf#Timestamp_extraction_configuration&lt;/A&gt; for more detail.&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Tue, 15 May 2018 03:51:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-UI-Some-JSON-Logs-Not-Being-Parsed-Correctly/m-p/398372#M71032</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2018-05-15T03:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk UI: Some JSON Logs Not Being Parsed Correctly</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-UI-Some-JSON-Logs-Not-Being-Parsed-Correctly/m-p/398373#M71033</link>
      <description>&lt;P&gt;@kahlerb, based on the sample data provided spath works just fine on the second JSON data. Following is a run anywhere example for you to test.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw=" {
     \"tags\": {
         \"client_id\": \"12312312312\",
         \"req_id\": \"79879879879879\"
     },
     \"timestamp\": \"2018-05-08T23:59:58Z\",
     \"application\": \"MY APPLICATION\",
     \"env\": \"development\",
     \"log_level\": \"INFO\",
     \"message\": \"Completed 200 OK in 21ms (Views: 8.0ms | ActiveRecord: 5.8ms)\"
 }"
 | spath
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 May 2018 04:02:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-UI-Some-JSON-Logs-Not-Being-Parsed-Correctly/m-p/398373#M71033</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-15T04:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk UI: Some JSON Logs Not Being Parsed Correctly</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-UI-Some-JSON-Logs-Not-Being-Parsed-Correctly/m-p/398374#M71034</link>
      <description>&lt;P&gt;Hi @niketnilay,&lt;/P&gt;

&lt;P&gt;your example is search time and works just fine, but the question asked is all related to parsing of the events &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Tue, 15 May 2018 04:06:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-UI-Some-JSON-Logs-Not-Being-Parsed-Correctly/m-p/398374#M71034</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2018-05-15T04:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk UI: Some JSON Logs Not Being Parsed Correctly</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-UI-Some-JSON-Logs-Not-Being-Parsed-Correctly/m-p/398375#M71035</link>
      <description>&lt;P&gt;@MuS, yes I was just trying to show that there is no issue with parsing of JSON. Hence issue was implied to be with data input (props.conf), as you have pointed out. I noticed you pin-pointed the issue after I posted my answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 May 2018 04:37:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-UI-Some-JSON-Logs-Not-Being-Parsed-Correctly/m-p/398375#M71035</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-15T04:37:38Z</dc:date>
    </item>
  </channel>
</rss>

