<?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 Connect for Kubernetes is parsing json string values as individual events in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Connect-for-Kubernetes-is-parsing-json-string-values-as/m-p/535134#M64570</link>
    <description>&lt;P class="lia-align-justify"&gt;In container logs on worker node, json is line by line and also&amp;nbsp; "/n" is included for each line&lt;/P&gt;&lt;P class="lia-align-justify"&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"log":"{\n","stream":"stdout","time":"2021-01-07T23:37:54.053738972Z"}
{"log":"  \"payload\" : \"\",\n","stream":"stdout","time":"2021-01-07T23:37:54.053746532Z"}
{"log":"  \"sessionInfo\" : {\n","stream":"stdout","time":"2021-01-07T23:37:54.053751058Z"}
{"log":"    \"userId\" : \"\",\n","stream":"stdout","time":"2021-01-07T23:37:54.053755004Z"}
{"log":"    \"sessionId\" : \"WT-3bF-VK35ZlXvqvUzT3kdkRsc\",\n","stream":"stdout","time":"2021-01-07T23:37:54.053759095Z"}
{"log":"    \"ipAddress\" : \"\",\n","stream":"stdout","time":"2021-01-07T23:37:54.053763148Z"}
{"log":"    \"endpoint\" : \""\n","stream":"stdout","time":"2021-01-07T23:37:54.053767198Z"}
{"log":"  }\n","stream":"stdout","time":"2021-01-07T23:37:54.053771398Z"}
{"log":"}\n","stream":"stdout","time":"2021-01-07T23:37:54.053780998Z"}&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 08 Jan 2021 01:16:57 GMT</pubDate>
    <dc:creator>svaj925</dc:creator>
    <dc:date>2021-01-08T01:16:57Z</dc:date>
    <item>
      <title>Splunk Connect for Kubernetes is parsing json string values as individual events</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Connect-for-Kubernetes-is-parsing-json-string-values-as/m-p/534831#M64548</link>
      <description>&lt;P&gt;We have applications running on OpenShift platform (v 3.11) and logs are written to STDOUT.&amp;nbsp; We have setup Splunk Connect for Kubernetes to forward logs from OpenShift to Splunk instance. Setup is working and we are able to see and search logs in Splunk but the issue we are facing is that all lines in Application logs are displayed as individual events in Splunk search, for example if there is some json string in logs then each value in json output is displayed as individual events as shown in below screenshot.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="screenshot.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/12439i24F0485B7F859DAE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="screenshot.png" alt="screenshot.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is the raw log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"sessionInfo" : {
"userId" : "",
"sessionId" : "bK7xzM16bpLXvaUGaWIODThJm9A",
"ipAddress" : "",
"endpoint" : ""
}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;I suspect some intermediary component between Openshift and splunk is doing this wrapping which might be throwing off the parser, that's my take but I'm not entirely sure about how Splunk Connect for Kubernetes is handling this. Any help/suggestions in fixing is greatly appreciated. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Note: Similar app logs which are forwarded to Splunk instance using universal forwarder from linux machine are displayed in correct format in Splunk search.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 18:23:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Connect-for-Kubernetes-is-parsing-json-string-values-as/m-p/534831#M64548</guid>
      <dc:creator>svaj925</dc:creator>
      <dc:date>2021-01-05T18:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Connect for Kubernetes is parsing json string values as individual events</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Connect-for-Kubernetes-is-parsing-json-string-values-as/m-p/534980#M64561</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This sounds like a typical multiline issue. Check crio logs on the worker node where your application pods are running.&amp;nbsp; If the displayed json is line by line - what i would guess - then you will need to setup multiline support in fluentd..&amp;nbsp;&lt;A href="https://github.com/splunk/splunk-connect-for-kubernetes/blob/8ba455e7f988d129c9bfa13fdcf2025c6c4ae724/helm-chart/splunk-connect-for-kubernetes/charts/splunk-kubernetes-logging/values.yaml#L191" target="_blank" rel="noopener"&gt;https://github.com/splunk/splunk-connect-for-kubernetes/blob/8ba455e7f988d129c9bfa13fdcf2025c6c4ae724/helm-chart/splunk-connect-for-kubernetes/charts/splunk-kubernetes-logging/values.yaml#L191&lt;/A&gt;&lt;/P&gt;&lt;P&gt;.. meaning you need to concat the event to fluentd before sending it to hec.&lt;/P&gt;&lt;P&gt;Another technical working solution is to fix the events in splunk on hec side. When your sourcetype for the damaged application is brokensourcetype set at SCK you can rename it, write it to&amp;nbsp;&lt;SPAN class="line"&gt;&lt;SPAN class="n"&gt;aggQueue and so fix it with splunk props.conf capabilities.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;props.conf&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="line"&gt;[brokensourcetype]&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;&lt;SPAN class="n"&gt;TRANSFORMS&lt;/SPAN&gt;-&lt;SPAN class="n"&gt;streams&lt;/SPAN&gt; =&lt;SPAN class="n"&gt;renamest&lt;/SPAN&gt;,&lt;SPAN class="n"&gt;write&lt;/SPAN&gt;-&lt;SPAN class="n"&gt;agg&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class="line"&gt;[jsonfixed]&lt;/SPAN&gt;
... fix your json here &lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="line"&gt;&lt;SPAN class="n"&gt;transforms.conf:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="line"&gt;[&lt;SPAN class="n"&gt;write&lt;/SPAN&gt;-&lt;SPAN class="n"&gt;agg&lt;/SPAN&gt;]&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;&lt;SPAN class="n"&gt;REGEX&lt;/SPAN&gt; = .*&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;&lt;SPAN class="n"&gt;DEST_KEY&lt;/SPAN&gt;=&lt;SPAN class="n"&gt;queue&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;&lt;SPAN class="n"&gt;FORMAT&lt;/SPAN&gt;=&lt;SPAN class="n"&gt;aggQueue&lt;/SPAN&gt;&lt;/SPAN&gt;

&lt;SPAN class="line"&gt;[&lt;SPAN class="n"&gt;renamest&lt;/SPAN&gt;]&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;&lt;SPAN class="n"&gt;REGEX&lt;/SPAN&gt; = .*&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;&lt;SPAN class="n"&gt;FORMAT&lt;/SPAN&gt; = &lt;SPAN class="n"&gt;sourcetype&lt;/SPAN&gt;::jsonfixed&lt;/SPAN&gt;
&lt;SPAN class="line"&gt;&lt;SPAN class="n"&gt;DEST_KEY&lt;/SPAN&gt; = &lt;SPAN class="n"&gt;MetaData&lt;/SPAN&gt;:&lt;SPAN class="n"&gt;Sourcetype&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 19:39:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Connect-for-Kubernetes-is-parsing-json-string-values-as/m-p/534980#M64561</guid>
      <dc:creator>schose</dc:creator>
      <dc:date>2021-01-06T19:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Connect for Kubernetes is parsing json string values as individual events</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Connect-for-Kubernetes-is-parsing-json-string-values-as/m-p/535134#M64570</link>
      <description>&lt;P class="lia-align-justify"&gt;In container logs on worker node, json is line by line and also&amp;nbsp; "/n" is included for each line&lt;/P&gt;&lt;P class="lia-align-justify"&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"log":"{\n","stream":"stdout","time":"2021-01-07T23:37:54.053738972Z"}
{"log":"  \"payload\" : \"\",\n","stream":"stdout","time":"2021-01-07T23:37:54.053746532Z"}
{"log":"  \"sessionInfo\" : {\n","stream":"stdout","time":"2021-01-07T23:37:54.053751058Z"}
{"log":"    \"userId\" : \"\",\n","stream":"stdout","time":"2021-01-07T23:37:54.053755004Z"}
{"log":"    \"sessionId\" : \"WT-3bF-VK35ZlXvqvUzT3kdkRsc\",\n","stream":"stdout","time":"2021-01-07T23:37:54.053759095Z"}
{"log":"    \"ipAddress\" : \"\",\n","stream":"stdout","time":"2021-01-07T23:37:54.053763148Z"}
{"log":"    \"endpoint\" : \""\n","stream":"stdout","time":"2021-01-07T23:37:54.053767198Z"}
{"log":"  }\n","stream":"stdout","time":"2021-01-07T23:37:54.053771398Z"}
{"log":"}\n","stream":"stdout","time":"2021-01-07T23:37:54.053780998Z"}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 08 Jan 2021 01:16:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Connect-for-Kubernetes-is-parsing-json-string-values-as/m-p/535134#M64570</guid>
      <dc:creator>svaj925</dc:creator>
      <dc:date>2021-01-08T01:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Connect for Kubernetes is parsing json string values as individual events</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Connect-for-Kubernetes-is-parsing-json-string-values-as/m-p/535224#M64582</link>
      <description>&lt;P&gt;I tried adding multiline as below (since our json output starts with "{")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;multiline:
        firstline: /^{/
        flushInterval: 1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now we can see json output parsing correctly as single event in some occurrences and in some cases, there are additional lines included in the same event (see below example).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="screenshot1.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/12487i0431F95A9B3F14C1/image-size/large?v=v2&amp;amp;px=999" role="button" title="screenshot1.png" alt="screenshot1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is there an option to include something like last/end line parameter to multiline options? or any other way to fix this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your help/suggestion regarding this issue.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 15:54:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Connect-for-Kubernetes-is-parsing-json-string-values-as/m-p/535224#M64582</guid>
      <dc:creator>svaj925</dc:creator>
      <dc:date>2021-01-08T15:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Connect for Kubernetes is parsing json string values as individual events</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Connect-for-Kubernetes-is-parsing-json-string-values-as/m-p/541668#M64988</link>
      <description>&lt;P&gt;Fluentd concat filter has many settings that should help you here...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/fluent-plugins-nursery/fluent-plugin-concat#parameter" target="_blank"&gt;https://github.com/fluent-plugins-nursery/fluent-plugin-concat#parameter&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any luck with your logs yet?&lt;/P&gt;</description>
      <pubDate>Sun, 28 Feb 2021 14:21:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Connect-for-Kubernetes-is-parsing-json-string-values-as/m-p/541668#M64988</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2021-02-28T14:21:08Z</dc:date>
    </item>
  </channel>
</rss>

