<?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: extract fields from json array with multivalue and sub-array in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/extract-fields-from-json-array-with-multivalue-and-sub-array/m-p/346978#M63721</link>
    <description>&lt;P&gt;Your &lt;CODE&gt;props.conf&lt;/CODE&gt; has an error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SHOULD_LINEMERGE=true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That may not be all that is wrong, but it definitely should be true instead of false.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Aug 2017 23:04:53 GMT</pubDate>
    <dc:creator>cpetterborg</dc:creator>
    <dc:date>2017-08-03T23:04:53Z</dc:date>
    <item>
      <title>extract fields from json array with multivalue and sub-array</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/extract-fields-from-json-array-with-multivalue-and-sub-array/m-p/346975#M63718</link>
      <description>&lt;P&gt;Here is my sample data&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
  "applications": [
    {
      "id": 2537302,
      "name": "addressdb_prod",
      "language": "dotnet",
      "health_status": "unknown",
      "reporting": true,
      "last_reported_at": "2017-08-03T10:41:52+00:00",
      "application_summary": {
        "response_time": 5.04,
        "throughput": 32.3,
        "error_rate": 0.0,
        "apdex_target": 0.5,
        "apdex_score": 1.0,
        "host_count": 2,
        "instance_count": 2
      },
      "settings": {
        "app_apdex_threshold": 0.5,
        "end_user_apdex_threshold": 7.0,
        "enable_real_user_monitoring": true,
        "use_server_side_config": false
      },
      "links": {
        "application_instances": [
          2536708,
          2561561
        ],
        "servers": [
          25610567,
          22686416
        ],
        "application_hosts": [
          2536699,
          2561553
        ]
      }
    },
    {
      "id": 2537304,
      "name": "addressdb_trn",
      "language": "dotnet",
      "health_status": "unknown",
      "reporting": true,
      "last_reported_at": "2017-08-03T10:41:47+00:00",
      "application_summary": {
        "response_time": 4.93,
        "throughput": 32.0,
        "error_rate": 0.0,
        "apdex_target": 0.5,
        "apdex_score": 1.0,
        "host_count": 2,
        "instance_count": 2
      },
      "settings": {
        "app_apdex_threshold": 0.5,
        "end_user_apdex_threshold": 7.0,
        "enable_real_user_monitoring": true,
        "use_server_side_config": false
      },
      "links": {
        "application_instances": [
          2536709,
          2561556
        ],
        "servers": [
          25610567,
          22686416
        ],
        "application_hosts": [
          2536699,
          2561553
        ]
      }
    },
    {
      "id": 2268424,
      "name": "All unnamed",
      "language": "dotnet",
      "health_status": "unknown",
      "reporting": true,
      "last_reported_at": "2017-08-03T10:41:52+00:00",
      "application_summary": {
        "response_time": 5.31,
        "throughput": 276.0,
        "error_rate": 0.0,
        "apdex_target": 0.5,
        "apdex_score": 1.0,
        "host_count": 7,
        "instance_count": 17
      },
      "settings": {
        "app_apdex_threshold": 0.5,
        "end_user_apdex_threshold": 7.0,
        "enable_real_user_monitoring": true,
        "use_server_side_config": false
      },
      "links": {
        "application_instances": [
          38654227,
          15703550,
          47088155,
          45753664,
          19172730,
          2561560,
          19335897,
          3249555,
          14322182,
          14322163,
          3249553,
          2536710,
          2561555,
          32941739,
          32941738
        ],
        "servers": [
          14652052,
          13742329,
          47086419,
          45753649,
          22686416,
          2512533,
          25610567
        ],
        "application_hosts": [
          19172728,
          2545902,
          47088154,
          45753663,
          2561553,
          2474911,
          2492596,
          2536699
        ]
      }
    },
    {
      "id": 2569403,
      "name": "allaboutme_dev",
      "language": "dotnet",
      "health_status": "gray",
      "reporting": false,
      "settings": {
        "app_apdex_threshold": 0.5,
        "end_user_apdex_threshold": 7.0,
        "enable_real_user_monitoring": true,
        "use_server_side_config": false
      },
      "links": {
        "application_instances": [],
        "servers": [],
        "application_hosts": []
      }
    },
    {
      "id": 17088365,
      "name": "api_cop_dev_emos",
      "language": "dotnet",
      "health_status": "gray",
      "reporting": false,
      "settings": {
        "app_apdex_threshold": 0.5,
        "end_user_apdex_threshold": 7.0,
        "enable_real_user_monitoring": true,
        "use_server_side_config": false
      },
      "links": {
        "application_instances": [],
        "servers": [],
        "application_hosts": []
      }
    }
    ],
  "links": {
    "application.servers": "/v2/servers?ids={server_ids}",
    "application.server": "/v2/servers/{server_id}",
    "application.application_hosts": "/v2/application/{application_id}/hosts?ids={host_ids}",
    "application.application_host": "/v2/application/{application_id}/hosts/{host_id}",
    "application.application_instances": "/v2/application/{application_id}/instances?ids={instance_ids}",
    "application.application_instance": "/v2/application/{application_id}/instances/{instance_id}",
    "application.alert_policy": "/v2/alert_policies/{alert_policy_id}"
  }
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried to follow the link&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;/P&gt;

&lt;P&gt;with configs in my props.conf file&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[json_no_timestamp:nrc]
SHOULD_LINEMERGE=false
LINE_BREAKER=((?&amp;lt;!"),|[\r\n]+)
SEDCMD-remove_prefix=s/{"applications":\[//g
SEDCMD-remove_suffix=s/\]}//g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, it does not seem to work. I assume, most likely, the regex is not correct. Venturing spath options as well.&lt;/P&gt;

&lt;P&gt;Any help will be appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 12:48:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/extract-fields-from-json-array-with-multivalue-and-sub-array/m-p/346975#M63718</guid>
      <dc:creator>ashabc</dc:creator>
      <dc:date>2017-08-03T12:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: extract fields from json array with multivalue and sub-array</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/extract-fields-from-json-array-with-multivalue-and-sub-array/m-p/346976#M63719</link>
      <description>&lt;P&gt;assuming you want to break before "id": try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;LINE_BREAKER=\{\s+\"id\"\:
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And maybe try to start first without the  SEDCMD-remove_prefix and SEDCMD-remove_suffix. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:13:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/extract-fields-from-json-array-with-multivalue-and-sub-array/m-p/346976#M63719</guid>
      <dc:creator>christianhuber</dc:creator>
      <dc:date>2020-09-29T15:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: extract fields from json array with multivalue and sub-array</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/extract-fields-from-json-array-with-multivalue-and-sub-array/m-p/346977#M63720</link>
      <description>&lt;P&gt;Thanks for your prompt response, christianhuber. I tried what you suggested, it does not work. Apparently, it parses every single line as an event. That is not the intention. &lt;/P&gt;

&lt;P&gt;An event should start at &lt;BR /&gt;
{&lt;BR /&gt;
"id": &lt;/P&gt;

&lt;P&gt;and finish at before the start of next&lt;BR /&gt;
{&lt;BR /&gt;
"id:"&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 21:17:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/extract-fields-from-json-array-with-multivalue-and-sub-array/m-p/346977#M63720</guid>
      <dc:creator>ashabc</dc:creator>
      <dc:date>2017-08-03T21:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: extract fields from json array with multivalue and sub-array</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/extract-fields-from-json-array-with-multivalue-and-sub-array/m-p/346978#M63721</link>
      <description>&lt;P&gt;Your &lt;CODE&gt;props.conf&lt;/CODE&gt; has an error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SHOULD_LINEMERGE=true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That may not be all that is wrong, but it definitely should be true instead of false.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 23:04:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/extract-fields-from-json-array-with-multivalue-and-sub-array/m-p/346978#M63721</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-08-03T23:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: extract fields from json array with multivalue and sub-array</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/extract-fields-from-json-array-with-multivalue-and-sub-array/m-p/346979#M63722</link>
      <description>&lt;P&gt;SHOULD_LINEMERGE=true does not make any difference. Still every single is parsed as a single event.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2017 00:57:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/extract-fields-from-json-array-with-multivalue-and-sub-array/m-p/346979#M63722</guid>
      <dc:creator>ashabc</dc:creator>
      <dc:date>2017-08-04T00:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: extract fields from json array with multivalue and sub-array</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/extract-fields-from-json-array-with-multivalue-and-sub-array/m-p/346980#M63723</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;try to see at the documentation  &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.6.2/Data/Configureeventlinebreaking" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.6.2/Data/Configureeventlinebreaking&lt;/A&gt;. I use for my json sources the following configuration.&lt;BR /&gt;
    [source::json_input]&lt;BR /&gt;
    KV_MODE = json&lt;BR /&gt;
    TRUNCATE = 0&lt;BR /&gt;
    BREAK_ONLY_BEFORE_DATE = false&lt;BR /&gt;
    LINE_BREAKER = **** your Line_Breaker  ****&lt;/P&gt;

&lt;P&gt;According to the Documentation this is not really correct, as it says with should_linemerge=true (which is default, so you don't have to add it) you should use BREAK_ONLY_BEFORE instead of LINE_BREAKER. Anyway for me it works. With the configuration above.&lt;/P&gt;

&lt;P&gt;The Truncate is only to asure that splunk doesn't truncate larger json arrays.  &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:12:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/extract-fields-from-json-array-with-multivalue-and-sub-array/m-p/346980#M63723</guid>
      <dc:creator>christianhuber</dc:creator>
      <dc:date>2020-09-29T15:12:41Z</dc:date>
    </item>
  </channel>
</rss>

