<?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 array into multiple events? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-json-array-into-multiple-events/m-p/264054#M50665</link>
    <description>&lt;P&gt;Hey! im having a similar issues, theres an array in my json that i want to grab and separate out as separate events. BREAK_ONLY_AFTER has been giving me some difficulties, what exactly do you mean by using a custom json array handler? I've gotten the data in via the REST API, all i need to do is parse it correctly.&lt;BR /&gt;
EDIT:&lt;BR /&gt;
I've found a different way, using SEDCMD to get rid of headers and footers of the object, and LINEBREAKER starting at the beginning of each event. i had an issue where LINEBREAKER wasn't working, where it was taking away everything in my parens, but i solved that by giving it just the comma inside the parens to eat, followed by the previous regex i had&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 15:31:53 GMT</pubDate>
    <dc:creator>alexwade13</dc:creator>
    <dc:date>2020-09-29T15:31:53Z</dc:date>
    <item>
      <title>How to split json array into multiple events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-json-array-into-multiple-events/m-p/264050#M50661</link>
      <description>&lt;P&gt;Hi , &lt;/P&gt;

&lt;P&gt;I have this json data which I am unable to parse through any of the props.conf mechanisms. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"meta": {"limit": 20, "next": "/api/v1/indicators/?username=xxxx&amp;amp;api_key=xxxxxxxxxxxxx&amp;amp;limit=20&amp;amp;offset=20", "offset": 0, "previous": null, "total_count": 570289}, "objects": [{"_id": "570f4f34c011fb78b52434d7", "actions": [], "activity": [], "attack_type": "Unknown", "bucket_list": ["Basic", "BR", "botnet", "low_confidence"], "campaign": [], "confidence": {"analyst": "Basic_Feed", "rating": "low"}, "created": "2016-04-14 04:05:08.677000", "impact": {"analyst": "Basic_Feed", "rating": "unknown"}, "locations": [], "modified": "2016-04-14 04:05:08.680000", "objects": [], "relationships": [], "releasability": [], "schema_version": 3, "screenshots": [], "sectors": [], "source": [{"instances": [{"analyst": "Basic_Feed", "date": "2016-04-14 04:05:08.679000", "method": "basic", "reference": "REF: &lt;A href="http://botscout.com/last_caught_cache.htm||Report" target="test_blank"&gt;http://botscout.com/last_caught_cache.htm||Report&lt;/A&gt; Date:2016-04-13T19:26:46Z||Confidence: 65"}], "name": "osint"}], "status": "New", "threat_type": "Unknown", "tickets": [], "type": "IPv4 Address", "value": "177.33.224.193"}, {"_id": "570f4f62c011fb78b52435a1", "actions": [], "activity": [], "attack_type": "Unknown", "bucket_list": ["Basic", "US", "botnet", "low_confidence"], "campaign": [], "confidence": {"analyst": "Basic_Feed", "rating": "low"}, "created": "2016-04-14 04:05:54.227000", "impact": {"analyst": "_Basic_Feed", "rating": "unknown"}, "locations": [], "modified": "2016-04-14 04:05:54.229000", "objects": [], "relationships": [], "releasability": [], "schema_version": 3, "screenshots": [], "sectors": [], "source": [{"instances": [{"analyst": "_Basic_Feed", "date": "2016-04-14 04:05:54.229000", "method": "_basic", "reference": "REF: &lt;A href="http://botscout.com/last_caught_cache.htm||Report" target="test_blank"&gt;http://botscout.com/last_caught_cache.htm||Report&lt;/A&gt; Date:2016-04-13T21:26:52Z||Confidence: 65"}], "name": "osint"}], "status": "New", "threat_type": "Unknown", "tickets": [], "type": "IPv4 Address", "value": "104.238.191.144"}, 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The log is json like format, although events appear to be in one single line and I'm unable to break them using line breakers.&lt;/P&gt;

&lt;P&gt;This is how my props.conf looks like after several different tries:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sourcetype = _json]
BREAK_ONLY_BEFORE_DATE = false
BREAK_ONLY_BEFORE = (\{|\[\s+{)
MUST_BREAK_AFTER = (\}|\}\s+\])
SEDCMD-remove_header = s/(\{\s+.+?\[)//g
SEDCMD-remove_trailing_commas = s/\},/}/g
SEDCMD-remove_footer = s/\]\s+\}//g
TIME_PREFIX = \"modified\":\s+\"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please help.&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2016 11:07:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-json-array-into-multiple-events/m-p/264050#M50661</guid>
      <dc:creator>Sanjai676</dc:creator>
      <dc:date>2016-05-25T11:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to split json array into multiple events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-json-array-into-multiple-events/m-p/264051#M50662</link>
      <description>&lt;P&gt;See if you can start by validating the JSON. The following website is a good resource for that:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://jsonlint.com/"&gt;http://jsonlint.com/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Once you've done this, the easiest way to break up your JSON into key/value format would be using props.conf and setting KV_MODE to JSON. &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/admin/Propsconf"&gt;http://docs.splunk.com/Documentation/Splunk/latest/admin/Propsconf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2016 13:45:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-json-array-into-multiple-events/m-p/264051#M50662</guid>
      <dc:creator>ryanoconnor</dc:creator>
      <dc:date>2016-05-25T13:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to split json array into multiple events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-json-array-into-multiple-events/m-p/264052#M50663</link>
      <description>&lt;P&gt;i have checked and validated the json data. I had tried the KV_MODE setting,but didn't workout. I found a thread which is very similar to what i'm facing. &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;
Although the same logic isn't working in my case.&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2016 07:45:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-json-array-into-multiple-events/m-p/264052#M50663</guid>
      <dc:creator>Sanjai676</dc:creator>
      <dc:date>2016-05-26T07:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to split json array into multiple events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-json-array-into-multiple-events/m-p/264053#M50664</link>
      <description>&lt;P&gt;Problem solved. I used the REST API modular app from Splunk and added a custom json array handler. Worked like a charm.!!&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2016 09:23:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-json-array-into-multiple-events/m-p/264053#M50664</guid>
      <dc:creator>Sanjai676</dc:creator>
      <dc:date>2016-05-27T09:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to split json array into multiple events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-json-array-into-multiple-events/m-p/264054#M50665</link>
      <description>&lt;P&gt;Hey! im having a similar issues, theres an array in my json that i want to grab and separate out as separate events. BREAK_ONLY_AFTER has been giving me some difficulties, what exactly do you mean by using a custom json array handler? I've gotten the data in via the REST API, all i need to do is parse it correctly.&lt;BR /&gt;
EDIT:&lt;BR /&gt;
I've found a different way, using SEDCMD to get rid of headers and footers of the object, and LINEBREAKER starting at the beginning of each event. i had an issue where LINEBREAKER wasn't working, where it was taking away everything in my parens, but i solved that by giving it just the comma inside the parens to eat, followed by the previous regex i had&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:31:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-json-array-into-multiple-events/m-p/264054#M50665</guid>
      <dc:creator>alexwade13</dc:creator>
      <dc:date>2020-09-29T15:31:53Z</dc:date>
    </item>
  </channel>
</rss>

