<?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: how to split multiline  JSON events/ Group multiline JSON event. in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/how-to-split-multiline-JSON-events-Group-multiline-JSON-event/m-p/417710#M94733</link>
    <description>&lt;P&gt;Hi @agoyal,&lt;/P&gt;

&lt;P&gt;I have tried with this json and able to make it.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[{"name": "TraderCurrency","type": "RiskBreakdown","duration": 1173,"count": 1,"average": 1173.0}, {"name": "CounterpartyPreSettlement","type": "RiskBreakdown","duration": 312934,"count": 1,"average": 312934.0}, {"name": "CounterpartyNotional","type": "RiskBreakdown","duration": 406789,"count": 1,"average": 406789.0}]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you please try this?&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[reset_profiler]
NO_BINARY_CHECK=true
BREAK_ONLY_BEFORE=([\{])
MUST_BREAK_AFTER=([\},])
SEDCMD-remove_bracket=s/\[|\]//g
LINE_BREAKER=(,\s)
KV_MODE=json
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can extract events like below:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5035i5988F07F95F5F7DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 25 May 2018 13:03:44 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2018-05-25T13:03:44Z</dc:date>
    <item>
      <title>how to split multiline  JSON events/ Group multiline JSON event.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-split-multiline-JSON-events-Group-multiline-JSON-event/m-p/417709#M94732</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;

&lt;P&gt;Log File&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ {
  "name" : "TraderCurrency",
  "type" : "RiskBreakdown",
  "duration" : 1173,
  "count" : 1,
  "average" : 1173.0
}, {
  "name" : "CounterpartyPreSettlement",
  "type" : "RiskBreakdown",
  "duration" : 312934,
  "count" : 1,
  "average" : 312934.0
}, {
  "name" : "CounterpartyNotional",
  "type" : "RiskBreakdown",
  "duration" : 406789,
  "count" : 1,
  "average" : 406789.0
} ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can remove "[ ] ," using sed to make it correct json.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;props.conf
[reset_profiler]
SEDCMD-remove_bracket = s/\[|\]//g
SEDCMD-remove_coma = s/\},/}\n/g
KV_MODE = json
NO_BINARY_CHECK = true
BREAK_ONLY_BEFORE  = \{
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 16:04:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-split-multiline-JSON-events-Group-multiline-JSON-event/m-p/417709#M94732</guid>
      <dc:creator>AKG1_old1</dc:creator>
      <dc:date>2018-05-24T16:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to split multiline  JSON events/ Group multiline JSON event.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-split-multiline-JSON-events-Group-multiline-JSON-event/m-p/417710#M94733</link>
      <description>&lt;P&gt;Hi @agoyal,&lt;/P&gt;

&lt;P&gt;I have tried with this json and able to make it.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[{"name": "TraderCurrency","type": "RiskBreakdown","duration": 1173,"count": 1,"average": 1173.0}, {"name": "CounterpartyPreSettlement","type": "RiskBreakdown","duration": 312934,"count": 1,"average": 312934.0}, {"name": "CounterpartyNotional","type": "RiskBreakdown","duration": 406789,"count": 1,"average": 406789.0}]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you please try this?&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[reset_profiler]
NO_BINARY_CHECK=true
BREAK_ONLY_BEFORE=([\{])
MUST_BREAK_AFTER=([\},])
SEDCMD-remove_bracket=s/\[|\]//g
LINE_BREAKER=(,\s)
KV_MODE=json
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can extract events like below:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5035i5988F07F95F5F7DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 13:03:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-split-multiline-JSON-events-Group-multiline-JSON-event/m-p/417710#M94733</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-05-25T13:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to split multiline  JSON events/ Group multiline JSON event.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-split-multiline-JSON-events-Group-multiline-JSON-event/m-p/417711#M94734</link>
      <description>&lt;P&gt;@kamlesh_vaghela : thanks for reply. Are you using all data in single line ?&lt;BR /&gt;
When i tried getting small issue that it's not recognize as json event because i guess " , " is removed at the end of every value.&lt;/P&gt;

&lt;P&gt;Thats what I am getting &lt;BR /&gt;
    {&lt;BR /&gt;
      "name" : "matrixAddonCurrencySwap"&lt;BR /&gt;
      "type" : "Formula"&lt;BR /&gt;
      "duration" : 0&lt;BR /&gt;
      "count" : 15&lt;BR /&gt;
      "average" : 0.0&lt;BR /&gt;
    } &lt;/P&gt;</description>
      <pubDate>Sun, 27 May 2018 09:58:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-split-multiline-JSON-events-Group-multiline-JSON-event/m-p/417711#M94734</guid>
      <dc:creator>AKG1_old1</dc:creator>
      <dc:date>2018-05-27T09:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to split multiline  JSON events/ Group multiline JSON event.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-split-multiline-JSON-events-Group-multiline-JSON-event/m-p/417712#M94735</link>
      <description>&lt;P&gt;@agoyal,&lt;/P&gt;

&lt;P&gt;Yes, I'm using single line data. For multi-line event use below conf.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[reset_profiler]
NO_BINARY_CHECK=true
BREAK_ONLY_BEFORE=([\{])
MUST_BREAK_AFTER=([\},])
SEDCMD-remove_bracket=s/\[|\]//g
LINE_BREAKER=(, )
KV_MODE=json
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm using following sample:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[{
        "name": "TraderCurrency",
        "type": "RiskBreakdown",
        "duration": 1173,
        "count": 1,
        "average": 1173.0
}, {
        "name": "CounterpartyPreSettlement",
        "type": "RiskBreakdown",
        "duration": 312934,
        "count": 1,
        "average": 312934.0
}, {
        "name": "CounterpartyNotional",
        "type": "RiskBreakdown",
        "duration": 406789,
        "count": 1,
        "average": 406789.0
}]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Happy Splunking&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 May 2018 06:36:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-split-multiline-JSON-events-Group-multiline-JSON-event/m-p/417712#M94735</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-05-28T06:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to split multiline  JSON events/ Group multiline JSON event.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-split-multiline-JSON-events-Group-multiline-JSON-event/m-p/417713#M94736</link>
      <description>&lt;P&gt;@kamlesh_vaghela : That's Great !! Thank you very much !! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;   Happy Splunking&lt;/P&gt;</description>
      <pubDate>Mon, 28 May 2018 08:24:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-split-multiline-JSON-events-Group-multiline-JSON-event/m-p/417713#M94736</guid>
      <dc:creator>AKG1_old1</dc:creator>
      <dc:date>2018-05-28T08:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to split multiline  JSON events/ Group multiline JSON event.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-split-multiline-JSON-events-Group-multiline-JSON-event/m-p/417714#M94737</link>
      <description>&lt;P&gt;@kamlesh_vaghela: Sorry, I forget to mention one case. one logfile having two blocks. In this case 2nd and 3rd event are not getting seprated. Not sure if possible to use multiple link breaker. &lt;/P&gt;

&lt;P&gt;[{&lt;BR /&gt;
         "name": "TraderCurrency",&lt;BR /&gt;
         "type": "RiskBreakdown",&lt;BR /&gt;
         "duration": 1173,&lt;BR /&gt;
         "count": 1,&lt;BR /&gt;
         "average": 1173.0&lt;BR /&gt;
 },{&lt;BR /&gt;
         "name": "TraderCurrency",&lt;BR /&gt;
         "type": "RiskBreakdown",&lt;BR /&gt;
         "duration": 1173,&lt;BR /&gt;
         "count": 1,&lt;BR /&gt;
         "average": 1173.0&lt;BR /&gt;
 } ]&lt;BR /&gt;
[ {&lt;BR /&gt;
         "name": "CounterpartyPreSettlement",&lt;BR /&gt;
         "type": "Formula",&lt;BR /&gt;
         "duration": 312934,&lt;BR /&gt;
         "count": 1,&lt;BR /&gt;
         "average": 312934.0&lt;BR /&gt;
 }, {&lt;BR /&gt;
         "name": "CounterpartyNotional",&lt;BR /&gt;
         "type": "Formula",&lt;BR /&gt;
         "duration": 406789,&lt;BR /&gt;
         "count": 1,&lt;BR /&gt;
         "average": 406789.0&lt;BR /&gt;
 }]&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 15:42:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-split-multiline-JSON-events-Group-multiline-JSON-event/m-p/417714#M94737</guid>
      <dc:creator>AKG1_old1</dc:creator>
      <dc:date>2018-06-05T15:42:43Z</dc:date>
    </item>
  </channel>
</rss>

