<?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 How to Split  JSON Array into Multiple Events using configuration ? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-Split-JSON-Array-into-Multiple-Events-using-configuration/m-p/422265#M7428</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;    {
     "cluster_call_quality":{
      "crPartyId" : "12345",
      "cluster_call_quality_summary":
        [
            {
              "clusterId":"Cluster1",
              "date":"2018-10-03",
              "totalNumberOfCalls":2000,
              "failedCalls" : 1000,
              "degradedCalls":200,
              "failedCallsPercentage" : 50,
              "degradedCallsPercentage":10
            },
            {
              "clusterId":"Cluster2",
              "date":"2018-11-04",
              "totalNumberOfCalls":1200,
              "failedCalls" : 400,
              "degradedCalls":300,
              "failedCallsPercentage" : 33,
              "degradedCallsPercentage":25
            },
            {
              "clusterId":"Cluster3",
              "date":"2018-12-05",
              "totalNumberOfCalls":700,
              "failedCalls" : 350,
              "degradedCalls":100,
              "failedCallsPercentage" : 50,
              "degradedCallsPercentage":14
            }
        ]
    }

    }



Output:-
3 events should come
with each events like below:-

 {
           "clusterId":"Cluster1",
           "date":"2018-10-03",
           "totalNumberOfCalls":2000,
           "failedCalls" : 1000,
           "degradedCalls":200,
           "failedCallsPercentage" : 50,
           "degradedCallsPercentage":10
         }
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 04 Dec 2018 09:42:29 GMT</pubDate>
    <dc:creator>karajada94</dc:creator>
    <dc:date>2018-12-04T09:42:29Z</dc:date>
    <item>
      <title>How to Split  JSON Array into Multiple Events using configuration ?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-Split-JSON-Array-into-Multiple-Events-using-configuration/m-p/422265#M7428</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;    {
     "cluster_call_quality":{
      "crPartyId" : "12345",
      "cluster_call_quality_summary":
        [
            {
              "clusterId":"Cluster1",
              "date":"2018-10-03",
              "totalNumberOfCalls":2000,
              "failedCalls" : 1000,
              "degradedCalls":200,
              "failedCallsPercentage" : 50,
              "degradedCallsPercentage":10
            },
            {
              "clusterId":"Cluster2",
              "date":"2018-11-04",
              "totalNumberOfCalls":1200,
              "failedCalls" : 400,
              "degradedCalls":300,
              "failedCallsPercentage" : 33,
              "degradedCallsPercentage":25
            },
            {
              "clusterId":"Cluster3",
              "date":"2018-12-05",
              "totalNumberOfCalls":700,
              "failedCalls" : 350,
              "degradedCalls":100,
              "failedCallsPercentage" : 50,
              "degradedCallsPercentage":14
            }
        ]
    }

    }



Output:-
3 events should come
with each events like below:-

 {
           "clusterId":"Cluster1",
           "date":"2018-10-03",
           "totalNumberOfCalls":2000,
           "failedCalls" : 1000,
           "degradedCalls":200,
           "failedCallsPercentage" : 50,
           "degradedCallsPercentage":10
         }
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Dec 2018 09:42:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-Split-JSON-Array-into-Multiple-Events-using-configuration/m-p/422265#M7428</guid>
      <dc:creator>karajada94</dc:creator>
      <dc:date>2018-12-04T09:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to Split  JSON Array into Multiple Events using configuration ?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-Split-JSON-Array-into-Multiple-Events-using-configuration/m-p/422266#M7429</link>
      <description>&lt;P&gt;@karajada94&lt;/P&gt;

&lt;P&gt;Basically, you have to add below configuration in props.conf. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[YOUR_SOURCETYPE]
BREAK_ONLY_BEFORE = (\{|\[\s+{)
DATETIME_CONFIG = 
MUST_BREAK_AFTER = (\}|\}\s+\])
NO_BINARY_CHECK = true
SEDCMD-a = s/(^\{)//g
SEDCMD-b = s/(.*cucm_cluster_call_quality.*)//g
SEDCMD-c = s/(.*crPartyId.*)//g
SEDCMD-d = s/(.*cucm_cluster_call_quality_summary.*)//g
SEDCMD-e = s/(.*[\[|\]].*)//g
SEDCMD-f = s/(\n})//g
SEDCMD-h = s/}(,)/}/g
SEDCMD-i = s/(^(?:[\t ]*(?:\r?\n|\r))+)//g
SEDCMD-j = s/(^}$)//g
SEDCMD-k = s/(\s)//g
category = Structured
disabled = false
pulldown_type = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you please try and let me know?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 14:26:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-Split-JSON-Array-into-Multiple-Events-using-configuration/m-p/422266#M7429</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-12-04T14:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to Split  JSON Array into Multiple Events using configuration ?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-Split-JSON-Array-into-Multiple-Events-using-configuration/m-p/422267#M7430</link>
      <description>&lt;P&gt;Use this line breaker config in props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SHOULD_LINEMERGE = false
LINE_BREAKER = (?:\[([\r\n\s]+))|(?:\}(,[\r\n\s]+)\{)|(?:([\r\n\s]+)\])
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which splits of the header, splits the events and splits off the footer closing brackets. You can then add some props and transforms to drop the header and footer bits.&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TRANSFORMS-setnull = json-drop-all,json-accept-real
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[json-drop-all]
REGEX = .*
DEST_KEY = queue
FORMAT = nullQueue

[json-accept-real]
REGEX = clusterId
DEST_KEY = queue
FORMAT = indexQueue
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Dec 2018 14:51:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-Split-JSON-Array-into-Multiple-Events-using-configuration/m-p/422267#M7430</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-12-04T14:51:41Z</dc:date>
    </item>
  </channel>
</rss>

