<?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 JSON Split at Index Time in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/JSON-Split-at-Index-Time/m-p/416071#M73519</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I have a JSON file output from a RESTful API service and the log looks something like this:&lt;/P&gt;

&lt;P&gt;{&lt;BR /&gt;
  "Provider": "Provider1",&lt;BR /&gt;
  "AccountId": "Account1",&lt;BR /&gt;
  "Status": "NON_COMPLIANT",&lt;BR /&gt;
  "AggregatedStatus": {&lt;BR /&gt;
    "Control1": "COMPLIANT",&lt;BR /&gt;
    "Control2": "NON_COMPLIANT",&lt;BR /&gt;
    "Control3": "COMPLIANT"&lt;BR /&gt;
  },&lt;BR /&gt;
  "ResourceCounter": 3,&lt;BR /&gt;
  "DetailedResult": [&lt;BR /&gt;
    {&lt;BR /&gt;
      "RuleName": "Rule1",&lt;BR /&gt;
      "ResourceID": "ID65329083",&lt;BR /&gt;
      "ResourceType": "Type1",&lt;BR /&gt;
      "Timestamp": "2019-07-25T06:53:13.030000",&lt;BR /&gt;
      "Status": "NON_COMPLIANT",&lt;BR /&gt;
      "Severity": "medium",&lt;BR /&gt;
      "Category": "Control1",&lt;BR /&gt;
      "SubCategory": "SubCat1"&lt;BR /&gt;
    },&lt;BR /&gt;
    {&lt;BR /&gt;
      "RuleName": "Rule2",&lt;BR /&gt;
      "ResourceID": "ID234ti4",&lt;BR /&gt;
      "ResourceType": "Type1",&lt;BR /&gt;
      "Timestamp": "2019-07-25T06:53:13.030000",&lt;BR /&gt;
      "Status": "NON_COMPLIANT",&lt;BR /&gt;
      "Severity": "medium",&lt;BR /&gt;
      "Category": "Control2",&lt;BR /&gt;
      "SubCategory": "SubCat2"&lt;BR /&gt;
    },&lt;BR /&gt;
    {&lt;BR /&gt;
      "RuleName": "Rule3",&lt;BR /&gt;
      "ResourceID": "ID7523427",&lt;BR /&gt;
      "ResourceType": "Type1",&lt;BR /&gt;
      "Timestamp": "2019-07-25T06:53:13.030000",&lt;BR /&gt;
      "Status": "NON_COMPLIANT",&lt;BR /&gt;
      "Severity": "medium",&lt;BR /&gt;
      "Category": "Control3",&lt;BR /&gt;
      "SubCategory": "SubCat3"&lt;BR /&gt;
    }&lt;BR /&gt;
  ]&lt;BR /&gt;
}&lt;/P&gt;

&lt;P&gt;Is it possible to split the JSON into multiple events and filter/index the output based on "Category": "Control2". Ideally, I would like to view the broken down events like this and may be filter events based on the "Category" field. Is this even possible?&lt;/P&gt;

&lt;P&gt;{&lt;BR /&gt;
  "Provider": "Provider1",&lt;BR /&gt;
  "AccountId": "Account1",&lt;BR /&gt;
  "Status": "NON_COMPLIANT",&lt;BR /&gt;
  "AggregatedStatus": {&lt;BR /&gt;
    "Control1": "COMPLIANT"&lt;BR /&gt;
  },&lt;BR /&gt;
  "ResourceCounter": 1,&lt;BR /&gt;
  "DetailedResult": [&lt;BR /&gt;
    {&lt;BR /&gt;
      "RuleName": "Rule1",&lt;BR /&gt;
      "ResourceID": "ID65329083",&lt;BR /&gt;
      "ResourceType": "Type1",&lt;BR /&gt;
      "Timestamp": "2019-07-25T06:53:13.030000",&lt;BR /&gt;
      "Status": "NON_COMPLIANT",&lt;BR /&gt;
      "Severity": "medium",&lt;BR /&gt;
      "Category": "Control1",&lt;BR /&gt;
      "SubCategory": "SubCat1"&lt;BR /&gt;
    }&lt;BR /&gt;
  ]&lt;/P&gt;

&lt;H2&gt;}&lt;/H2&gt;

&lt;P&gt;{&lt;BR /&gt;
  "Provider": "Provider1",&lt;BR /&gt;
  "AccountId": "Account1",&lt;BR /&gt;
  "Status": "NON_COMPLIANT",&lt;BR /&gt;
  "AggregatedStatus": {&lt;BR /&gt;
    "Control2": "NON_COMPLIANT"&lt;BR /&gt;
  },&lt;BR /&gt;
  "ResourceCounter": 1,&lt;BR /&gt;
  "DetailedResult": [&lt;BR /&gt;
    {&lt;BR /&gt;
      "RuleName": "Rule2",&lt;BR /&gt;
      "ResourceID": "ID234ti4",&lt;BR /&gt;
      "ResourceType": "Type1",&lt;BR /&gt;
      "Timestamp": "2019-07-25T06:53:13.030000",&lt;BR /&gt;
      "Status": "NON_COMPLIANT",&lt;BR /&gt;
      "Severity": "medium",&lt;BR /&gt;
      "Category": "Control2",&lt;BR /&gt;
      "SubCategory": "SubCat2"&lt;BR /&gt;
    }&lt;BR /&gt;
  ]&lt;BR /&gt;
}&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;{&lt;BR /&gt;
  "Provider": "Provider1",&lt;BR /&gt;
  "AccountId": "Account1",&lt;BR /&gt;
  "Status": "NON_COMPLIANT",&lt;BR /&gt;
  "AggregatedStatus": {&lt;BR /&gt;
    "Control3": "COMPLIANT"&lt;BR /&gt;
  },&lt;BR /&gt;
  "ResourceCounter": 1,&lt;BR /&gt;
  "DetailedResult": [&lt;BR /&gt;
    {&lt;BR /&gt;
      "RuleName": "Rule3",&lt;BR /&gt;
      "ResourceID": "ID7523427",&lt;BR /&gt;
      "ResourceType": "Type1",&lt;BR /&gt;
      "Timestamp": "2019-07-25T06:53:13.030000",&lt;BR /&gt;
      "Status": "NON_COMPLIANT",&lt;BR /&gt;
      "Severity": "medium",&lt;BR /&gt;
      "Category": "Control3",&lt;BR /&gt;
      "SubCategory": "SubCat3"&lt;BR /&gt;
    }&lt;BR /&gt;
  ]&lt;BR /&gt;
}&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Krishna&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 01:31:20 GMT</pubDate>
    <dc:creator>krishnakesiraju</dc:creator>
    <dc:date>2020-09-30T01:31:20Z</dc:date>
    <item>
      <title>JSON Split at Index Time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/JSON-Split-at-Index-Time/m-p/416071#M73519</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I have a JSON file output from a RESTful API service and the log looks something like this:&lt;/P&gt;

&lt;P&gt;{&lt;BR /&gt;
  "Provider": "Provider1",&lt;BR /&gt;
  "AccountId": "Account1",&lt;BR /&gt;
  "Status": "NON_COMPLIANT",&lt;BR /&gt;
  "AggregatedStatus": {&lt;BR /&gt;
    "Control1": "COMPLIANT",&lt;BR /&gt;
    "Control2": "NON_COMPLIANT",&lt;BR /&gt;
    "Control3": "COMPLIANT"&lt;BR /&gt;
  },&lt;BR /&gt;
  "ResourceCounter": 3,&lt;BR /&gt;
  "DetailedResult": [&lt;BR /&gt;
    {&lt;BR /&gt;
      "RuleName": "Rule1",&lt;BR /&gt;
      "ResourceID": "ID65329083",&lt;BR /&gt;
      "ResourceType": "Type1",&lt;BR /&gt;
      "Timestamp": "2019-07-25T06:53:13.030000",&lt;BR /&gt;
      "Status": "NON_COMPLIANT",&lt;BR /&gt;
      "Severity": "medium",&lt;BR /&gt;
      "Category": "Control1",&lt;BR /&gt;
      "SubCategory": "SubCat1"&lt;BR /&gt;
    },&lt;BR /&gt;
    {&lt;BR /&gt;
      "RuleName": "Rule2",&lt;BR /&gt;
      "ResourceID": "ID234ti4",&lt;BR /&gt;
      "ResourceType": "Type1",&lt;BR /&gt;
      "Timestamp": "2019-07-25T06:53:13.030000",&lt;BR /&gt;
      "Status": "NON_COMPLIANT",&lt;BR /&gt;
      "Severity": "medium",&lt;BR /&gt;
      "Category": "Control2",&lt;BR /&gt;
      "SubCategory": "SubCat2"&lt;BR /&gt;
    },&lt;BR /&gt;
    {&lt;BR /&gt;
      "RuleName": "Rule3",&lt;BR /&gt;
      "ResourceID": "ID7523427",&lt;BR /&gt;
      "ResourceType": "Type1",&lt;BR /&gt;
      "Timestamp": "2019-07-25T06:53:13.030000",&lt;BR /&gt;
      "Status": "NON_COMPLIANT",&lt;BR /&gt;
      "Severity": "medium",&lt;BR /&gt;
      "Category": "Control3",&lt;BR /&gt;
      "SubCategory": "SubCat3"&lt;BR /&gt;
    }&lt;BR /&gt;
  ]&lt;BR /&gt;
}&lt;/P&gt;

&lt;P&gt;Is it possible to split the JSON into multiple events and filter/index the output based on "Category": "Control2". Ideally, I would like to view the broken down events like this and may be filter events based on the "Category" field. Is this even possible?&lt;/P&gt;

&lt;P&gt;{&lt;BR /&gt;
  "Provider": "Provider1",&lt;BR /&gt;
  "AccountId": "Account1",&lt;BR /&gt;
  "Status": "NON_COMPLIANT",&lt;BR /&gt;
  "AggregatedStatus": {&lt;BR /&gt;
    "Control1": "COMPLIANT"&lt;BR /&gt;
  },&lt;BR /&gt;
  "ResourceCounter": 1,&lt;BR /&gt;
  "DetailedResult": [&lt;BR /&gt;
    {&lt;BR /&gt;
      "RuleName": "Rule1",&lt;BR /&gt;
      "ResourceID": "ID65329083",&lt;BR /&gt;
      "ResourceType": "Type1",&lt;BR /&gt;
      "Timestamp": "2019-07-25T06:53:13.030000",&lt;BR /&gt;
      "Status": "NON_COMPLIANT",&lt;BR /&gt;
      "Severity": "medium",&lt;BR /&gt;
      "Category": "Control1",&lt;BR /&gt;
      "SubCategory": "SubCat1"&lt;BR /&gt;
    }&lt;BR /&gt;
  ]&lt;/P&gt;

&lt;H2&gt;}&lt;/H2&gt;

&lt;P&gt;{&lt;BR /&gt;
  "Provider": "Provider1",&lt;BR /&gt;
  "AccountId": "Account1",&lt;BR /&gt;
  "Status": "NON_COMPLIANT",&lt;BR /&gt;
  "AggregatedStatus": {&lt;BR /&gt;
    "Control2": "NON_COMPLIANT"&lt;BR /&gt;
  },&lt;BR /&gt;
  "ResourceCounter": 1,&lt;BR /&gt;
  "DetailedResult": [&lt;BR /&gt;
    {&lt;BR /&gt;
      "RuleName": "Rule2",&lt;BR /&gt;
      "ResourceID": "ID234ti4",&lt;BR /&gt;
      "ResourceType": "Type1",&lt;BR /&gt;
      "Timestamp": "2019-07-25T06:53:13.030000",&lt;BR /&gt;
      "Status": "NON_COMPLIANT",&lt;BR /&gt;
      "Severity": "medium",&lt;BR /&gt;
      "Category": "Control2",&lt;BR /&gt;
      "SubCategory": "SubCat2"&lt;BR /&gt;
    }&lt;BR /&gt;
  ]&lt;BR /&gt;
}&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;{&lt;BR /&gt;
  "Provider": "Provider1",&lt;BR /&gt;
  "AccountId": "Account1",&lt;BR /&gt;
  "Status": "NON_COMPLIANT",&lt;BR /&gt;
  "AggregatedStatus": {&lt;BR /&gt;
    "Control3": "COMPLIANT"&lt;BR /&gt;
  },&lt;BR /&gt;
  "ResourceCounter": 1,&lt;BR /&gt;
  "DetailedResult": [&lt;BR /&gt;
    {&lt;BR /&gt;
      "RuleName": "Rule3",&lt;BR /&gt;
      "ResourceID": "ID7523427",&lt;BR /&gt;
      "ResourceType": "Type1",&lt;BR /&gt;
      "Timestamp": "2019-07-25T06:53:13.030000",&lt;BR /&gt;
      "Status": "NON_COMPLIANT",&lt;BR /&gt;
      "Severity": "medium",&lt;BR /&gt;
      "Category": "Control3",&lt;BR /&gt;
      "SubCategory": "SubCat3"&lt;BR /&gt;
    }&lt;BR /&gt;
  ]&lt;BR /&gt;
}&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Krishna&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:31:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/JSON-Split-at-Index-Time/m-p/416071#M73519</guid>
      <dc:creator>krishnakesiraju</dc:creator>
      <dc:date>2020-09-30T01:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: JSON Split at Index Time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/JSON-Split-at-Index-Time/m-p/416072#M73520</link>
      <description>&lt;P&gt;I think you need to create a scripted input to break the file up like that.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 13:31:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/JSON-Split-at-Index-Time/m-p/416072#M73520</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-07-29T13:31:41Z</dc:date>
    </item>
  </channel>
</rss>

