<?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 Breaking events JSON in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Breaking-events-JSON/m-p/400072#M71244</link>
    <description>&lt;P&gt;For some reason the LINE_BREAKER option for Splunk keeps turning a JSON log file into a single event, ignoring everything after the first event. Does anyone have any experience with breaking the events up for the following log?:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"aModLR":{"attributes":{"affected":"topology/pod/node/av/node","cause":"transition","changeSet":"targetMn (Old: AAA, New: BBB)","childAction":"","clientTag":"","code":"E69","created":"2019-07-18T16:38:41.501+02:00","descr":"Node modified","dn":"subj-[topology/pod/node/av/node]/mod-43243","id":"23432","ind":"modification","modTs":"never","sessionId":"ABCD",severity":"info","status":"","trig":"config","txId":"18374686479671625257","user":"admin"}}},{"aModLR":{"attributes":{"affected":"pluginPolContr/pluginPol","cause":"transition","changeSet":"verifySignature:enable","childAction":"","clientTag":"","code":"E68","created":"2019-07-18T10:31:11.748+02:00","descr":"PluginPol created","dn":"subj-[pluginPolContr/pluginPol]/mod-1234","id":"12345","ind":"creation","modTs":"never","sessionId":"ABCDEF123",severity":"info","status":"","trig":"config","txId":"5645","user":"admin2"}}}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've tried BREAK_ONLY_BEFORE = {"aModLR" or LINE_BREAKER = {"aModLR() but it still turns it into a single event.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 01:24:39 GMT</pubDate>
    <dc:creator>mmoermans</dc:creator>
    <dc:date>2020-09-30T01:24:39Z</dc:date>
    <item>
      <title>Breaking events JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Breaking-events-JSON/m-p/400072#M71244</link>
      <description>&lt;P&gt;For some reason the LINE_BREAKER option for Splunk keeps turning a JSON log file into a single event, ignoring everything after the first event. Does anyone have any experience with breaking the events up for the following log?:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"aModLR":{"attributes":{"affected":"topology/pod/node/av/node","cause":"transition","changeSet":"targetMn (Old: AAA, New: BBB)","childAction":"","clientTag":"","code":"E69","created":"2019-07-18T16:38:41.501+02:00","descr":"Node modified","dn":"subj-[topology/pod/node/av/node]/mod-43243","id":"23432","ind":"modification","modTs":"never","sessionId":"ABCD",severity":"info","status":"","trig":"config","txId":"18374686479671625257","user":"admin"}}},{"aModLR":{"attributes":{"affected":"pluginPolContr/pluginPol","cause":"transition","changeSet":"verifySignature:enable","childAction":"","clientTag":"","code":"E68","created":"2019-07-18T10:31:11.748+02:00","descr":"PluginPol created","dn":"subj-[pluginPolContr/pluginPol]/mod-1234","id":"12345","ind":"creation","modTs":"never","sessionId":"ABCDEF123",severity":"info","status":"","trig":"config","txId":"5645","user":"admin2"}}}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've tried BREAK_ONLY_BEFORE = {"aModLR" or LINE_BREAKER = {"aModLR() but it still turns it into a single event.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:24:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Breaking-events-JSON/m-p/400072#M71244</guid>
      <dc:creator>mmoermans</dc:creator>
      <dc:date>2020-09-30T01:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Breaking events JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Breaking-events-JSON/m-p/400073#M71245</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;LINE_BREAKER = \{\"aModLR\"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think you need to escape the string.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="{\"aModLR\":{\"attributes\":{\"affected\":\"topology/pod/node/av/node\",\"cause\":\"transition\",\"changeSet\":\"targetMn (Old: AAA, New: BBB)\",\"childAction\":\"\",\"clientTag\":\"\",\"code\":\"E69\",\"created\":\"2019-07-18T16:38:41.501+02:00\",\"descr\":\"Node modified\",\"dn\":\"subj-[topology/pod/node/av/node]/mod-43243\",\"id\":\"23432\",\"ind\":\"modification\",\"modTs\":\"never\",\"sessionId\":\"ABCD\",\"severity\":\"info\",\"status\":\"\",\"trig\":\"config\",\"txId\":\"18374686479671625257\",\"user\":\"admin\"}}}"
| appendpipe 
    [eval _raw="{\"aModLR\":{\"attributes\":{\"affected\":\"pluginPolContr/pluginPol\",\"cause\":\"transition\",\"changeSet\":\"verifySignature:enable\",\"childAction\":\"\",\"clientTag\":\"\",\"code\":\"E68\",\"created\":\"2019-07-18T10:31:11.748+02:00\",\"descr\":\"PluginPol created\",\"dn\":\"subj-[pluginPolContr/pluginPol]/mod-1234\",\"id\":\"12345\",\"ind\":\"creation\",\"modTs\":\"never\",\"sessionId\":\"ABCDEF123\",\"severity\":\"info\",\"status\":\"\",\"trig\":\"config\",\"txId\":\"5645\",\"user\":\"admin2\"}}}"]
| rex mode=sed "s/({|\\\",)/\1\n/g"
| spath
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried extracting fields with a query as an example.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2019 02:02:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Breaking-events-JSON/m-p/400073#M71245</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-26T02:02:34Z</dc:date>
    </item>
  </channel>
</rss>

