<?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  JSON into multiple events using regex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-JSON-into-multiple-events-using-regex/m-p/402415#M167875</link>
    <description>&lt;P&gt;This just seems to put it back into one event. I need multiple events.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Aug 2018 22:16:07 GMT</pubDate>
    <dc:creator>Zamoraw</dc:creator>
    <dc:date>2018-08-14T22:16:07Z</dc:date>
    <item>
      <title>How to split  JSON into multiple events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-JSON-into-multiple-events-using-regex/m-p/402413#M167873</link>
      <description>&lt;P&gt;I am currently trying to split my json into multiple events at index time into Splunk. Although when I do this it breaks each line into multiple events. I am not good with regex, so I tried using the regex from the answer here&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/289520/how-to-split-a-json-array-into-multiple-events-wit.html"&gt;https://answers.splunk.com/answers/289520/how-to-split-a-json-array-into-multiple-events-wit.html&lt;/A&gt;&lt;BR /&gt;
The answer is exactly how I want my output to be.&lt;BR /&gt;
Heres my props.conf and my sample json &lt;BR /&gt;
1.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[jsonsourcetype]
SHOULD_LINEMERGE = FALSE
LINE_BREAKER = ((?&amp;lt;!")\},|[\r\n]+)
SEDCMD-remove_header = s/(\{\s+.+?\[)//g
SEDCMD-remove_footer = s/\]\s+\}//g
TIME_PREFIX = \"CreatedDate\":\s+\"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
"records": [
    {
        "field1": "923893829413",
        "CreatedDate": "2018-08-10T06:24:35.000+0000",
        "Id": "a8928371DL0",
        "attributes": {
            "type": "F",
            "url": "/something/etc/test"
        }
    },               
  {
        "field1": "923829323829413",
        "Id": "a8921238371DL01",
        "attributes": {
            "type": "TF",
            "url": "urlHere"
        }
    }          
]
}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Aug 2018 21:25:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-JSON-into-multiple-events-using-regex/m-p/402413#M167873</guid>
      <dc:creator>Zamoraw</dc:creator>
      <dc:date>2018-08-14T21:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to split  JSON into multiple events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-JSON-into-multiple-events-using-regex/m-p/402414#M167874</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;BREAK_ONLY_BEFORE = (\[\s+\{)
MUST_BREAK_AFTER = (\},|\}\s+\])
SEDCMD-remove_header = s/(\{\s+.+?\[)//g
SEDCMD-remove_footer = s/\]\s+\}//g
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Aug 2018 21:57:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-JSON-into-multiple-events-using-regex/m-p/402414#M167874</guid>
      <dc:creator>amiftah</dc:creator>
      <dc:date>2018-08-14T21:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to split  JSON into multiple events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-JSON-into-multiple-events-using-regex/m-p/402415#M167875</link>
      <description>&lt;P&gt;This just seems to put it back into one event. I need multiple events.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2018 22:16:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-JSON-into-multiple-events-using-regex/m-p/402415#M167875</guid>
      <dc:creator>Zamoraw</dc:creator>
      <dc:date>2018-08-14T22:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to split  JSON into multiple events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-JSON-into-multiple-events-using-regex/m-p/402416#M167876</link>
      <description>&lt;P&gt;Did you try it?&lt;BR /&gt;
I have two separate events, unless if it's not what you want..&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/5542i2B1BBE6149E36F92/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>Wed, 15 Aug 2018 00:10:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-JSON-into-multiple-events-using-regex/m-p/402416#M167876</guid>
      <dc:creator>amiftah</dc:creator>
      <dc:date>2018-08-15T00:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to split  JSON into multiple events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-JSON-into-multiple-events-using-regex/m-p/402417#M167877</link>
      <description>&lt;P&gt;Yes, I tried it but my output was one event. This is exactly what I need. But for some reason Its not working on mine.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 00:15:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-JSON-into-multiple-events-using-regex/m-p/402417#M167877</guid>
      <dc:creator>Zamoraw</dc:creator>
      <dc:date>2018-08-15T00:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to split  JSON into multiple events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-JSON-into-multiple-events-using-regex/m-p/402418#M167878</link>
      <description>&lt;P&gt;Ok, here's the source type I used for this output:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[test22]
BREAK_ONLY_BEFORE = BREAK_ONLY_BEFORE
DATETIME_CONFIG =
MUST_BREAK_AFTER = (\},|\}\s+\])
NO_BINARY_CHECK = true
SEDCMD-remove_footer = s/\]\s+\}//g
SEDCMD-remove_header = s/(\{\s+.+?\[)//g
TIME_PREFIX = \"CreatedDate\":\s+\"
category = Custom
pulldown_type = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Try to reindex your file with that same source type&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 00:17:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-JSON-into-multiple-events-using-regex/m-p/402418#M167878</guid>
      <dc:creator>amiftah</dc:creator>
      <dc:date>2018-08-15T00:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to split  JSON into multiple events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-JSON-into-multiple-events-using-regex/m-p/402419#M167879</link>
      <description>&lt;P&gt;Awesome, Thanks! After adding this with the comment you posted in the other answer it worked great! Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 16:04:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-JSON-into-multiple-events-using-regex/m-p/402419#M167879</guid>
      <dc:creator>Zamoraw</dc:creator>
      <dc:date>2018-08-15T16:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to split  JSON into multiple events using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-JSON-into-multiple-events-using-regex/m-p/402420#M167880</link>
      <description>&lt;P&gt;Thank you this works and I understand most of it except that first line BREAK_ONLY_BEFORE = BREAK_ONLY_BEFORE. Could you explain that a bit?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:52:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-JSON-into-multiple-events-using-regex/m-p/402420#M167880</guid>
      <dc:creator>Zamoraw</dc:creator>
      <dc:date>2020-09-29T20:52:33Z</dc:date>
    </item>
  </channel>
</rss>

