<?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 Nested JSON in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-Nested-JSON/m-p/562007#M195458</link>
    <description>&lt;P&gt;Yes. &lt;STRONG&gt;KV_MODE = json&lt;/STRONG&gt; is set on the search head.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Aug 2021 04:49:30 GMT</pubDate>
    <dc:creator>kernand0</dc:creator>
    <dc:date>2021-08-04T04:49:30Z</dc:date>
    <item>
      <title>Extract Nested JSON</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Nested-JSON/m-p/561905#M195431</link>
      <description>&lt;P&gt;I have events coming from an API that all have the same 10 fields.&amp;nbsp; Viewing the RAW event one of the fields (detail) is quote escaped JSON (\").&amp;nbsp; The contents of the field varies and I cannot get consistent parsing via configuration files.&amp;nbsp; &amp;nbsp;The &lt;U&gt;props.conf&lt;/U&gt; does already include &lt;STRONG&gt;KV_MODE = json&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I add &lt;STRONG&gt;| spath input=detail&amp;nbsp;&lt;/STRONG&gt;to the SPL it parses perfectly, but I need to do the parsing from the config files so I can build Datamodels.&amp;nbsp; &amp;nbsp;Since KV's vary across events parsing the whole detail field verses regex's on specifc KV's seems to be more efficient.&amp;nbsp; &amp;nbsp;I've had limited success using a regex in &lt;U&gt;transforms.conf&lt;/U&gt;.&amp;nbsp; And I think trying to use the&amp;nbsp;&lt;STRONG&gt;| eval details = spath(X,Y)&amp;nbsp;&lt;/STRONG&gt;won't work because there are multiple keys and values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Some sample events are below.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;{"edgeName": "DVC_NAME", "enterpriseUsername": null, "event": "EDGE_NEW_DEVICE", "category": "EDGE", "id":&amp;nbsp;12345678, "segmentName": null, "severity": "NOTICE", "eventTime": "2021-08-03T13:21:31.000Z", "message": "New or updated client device&amp;nbsp;01:23:45:67:ab:ef, ip 192.168.0.100, segId 0, hostname NT_HOSTNAME, os", "detail": "{\"last_request_time\":0,\"client_mac\":\"01:23:45:67:ab:ef\",\"client_ipv4addr\":\"192.168.0.100\",\"hostname\":\"NT_HOSTNAME\",\"os_type\":0,\"os_class\":0,\"os_class_name\":\"UNKNOWN\",\"os_version\":\"\",\"device_type\":\"\",\"os_description\":\"\",\"dhcp_param_list\":\"1,3,6,15,31,33,43,44,46,47,119,121,249,252\",\"segment_id\":0}"}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;{"id": 73646231, "severity": "INFO", "eventTime": "2021-08-03T06:36:31.000Z", "segmentName": null, "message": "Edge [DVC_NAME] has re-established communication with the Orchestrator", "category": "EDGE", "event": "EDGE_UP", "enterpriseUsername": null, "detail": "{\"enterpriseAlertConfigurationId\":null,\"enterpriseId\":316,\"edgeId\":8748,\"edgeName\":\"DVC_NAME\",\"state\":\"PENDING\",\"stateSetTime\":\"2021-08-03T06:36:30.867Z\",\"triggerTime\":\"2021-08-03T06:36:30.867Z\",\"remainingNotifications\":1,\"nextNotificationTime\":\"2021-08-03T06:36:30.867Z\",\"lastContact\":\"2021-08-03T06:36:29.000Z\",\"name\":\"EDGE_UP\",\"type\":\"EDGE_UP\",\"firstNotificationSeconds\":0,\"maxNotifications\":1,\"notificationIntervalSeconds\":120,\"resetIntervalSeconds\":3600,\"timezone\":\"America/Phoenix\",\"locale\":null}", "edgeName": "DVC_NAME"}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;{"edgeName": "DVC_NAME", "id": 73579676, "eventTime": "2021-08-02T23:24:58.000Z", "event": "MGD_CONF_APPLIED", "severity": "INFO", "segmentName": null, "enterpriseUsername": null, "detail": "{\"heartBeatSeconds\": 30, \"managementPlaneProxy\": {\"drHeartbeatSecs\": 60, \"primary\": \"host-1.domain.net\", \"secondary\": \"host-2.domain.net\"}, \"timeSliceSeconds\": 300, \"statsUploadSeconds\": 300}", "message": "Applied new configuration for managementPlane version 1627946184323", "category": "EDGE"}&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 14:47:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Nested-JSON/m-p/561905#M195431</guid>
      <dc:creator>kernand0</dc:creator>
      <dc:date>2021-08-03T14:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Nested JSON</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Nested-JSON/m-p/561988#M195453</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6033"&gt;@kernand0&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;that's good when its working with spath, where did you set KV_MODE = json ?&amp;nbsp; Props having KV_MODE shall be deployed to Search head.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 01:17:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Nested-JSON/m-p/561988#M195453</guid>
      <dc:creator>venkatasri</dc:creator>
      <dc:date>2021-08-04T01:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Nested JSON</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Nested-JSON/m-p/562007#M195458</link>
      <description>&lt;P&gt;Yes. &lt;STRONG&gt;KV_MODE = json&lt;/STRONG&gt; is set on the search head.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 04:49:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Nested-JSON/m-p/562007#M195458</guid>
      <dc:creator>kernand0</dc:creator>
      <dc:date>2021-08-04T04:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Nested JSON</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Nested-JSON/m-p/562018#M195462</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6033"&gt;@kernand0&lt;/a&gt;&amp;nbsp; Can you run a btool and check what props have been considered&amp;nbsp; on SH?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;./splunk btool props list --debug | grep &amp;lt;your_sourcetype_here&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 05:35:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Nested-JSON/m-p/562018#M195462</guid>
      <dc:creator>venkatasri</dc:creator>
      <dc:date>2021-08-04T05:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Nested JSON</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Nested-JSON/m-p/562256#M195557</link>
      <description>&lt;P&gt;The host is an AIO Splunk instance but here is the output of btool for props.conf:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;FONT face="courier new,courier"&gt;[velocloud:api]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ADD_EXTRA_TIME_FIELDS = True&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ANNOTATE_PUNCT = True&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;AUTO_KV_JSON = true&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;BREAK_ONLY_BEFORE =&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;BREAK_ONLY_BEFORE_DATE = True&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;CHARSET = UTF-8&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DATETIME_CONFIG = /etc/datetime.xml&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DEPTH_LIMIT = 1000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;EVAL action = &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;HEADER_MODE =&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;KV_MODE = JSON&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;LEARN_MODEL = true&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;LEARN_SOURCETYPE = true&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;LINE_BREAKER_LOOKBEHIND = 100&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;MATCH_LIMIT = 100000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;MAX_DAYS_AGO = 2000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;MAX_DAYS_HENCE = 2&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;MAX_DIFF_SECS_AGO = 3600&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;MAX_DIFF_SECS_HENCE = 604800&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;MAX_EVENTS = 256&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;MAX_TIMESTAMP_LOOKAHEAD = 128&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;MUST_BREAK_AFTER =&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;MUST_NOT_BREAK_AFTER =&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;MUST_NOT_BREAK_BEFORE =&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;SEGMENTATION = indexing&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;SEGMENTATION-all = full&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;SEGMENTATION-inner = inner&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;SEGMENTATION-outer = outer&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;SEGMENTATION-raw = none&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;SEGMENTATION-standard = standard&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;SHOULD_LINEMERGE = True&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;TIME_FORMAT = %Y-%m-%dT%H:%M:%S%Z&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;TIME_PREFIX = \"eventTime\"\s*\:\s*\"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;TRANSFORMS =&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;TRANSFORMS-core = velocloud_host&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;TRUNCATE = 10000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;TZ = UTC&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;detect_trailing_nulls = false&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;maxDist = 100&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;priority =&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;sourcetype =&lt;/FONT&gt;&lt;/LI-SPOILER&gt;</description>
      <pubDate>Thu, 05 Aug 2021 13:26:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Nested-JSON/m-p/562256#M195557</guid>
      <dc:creator>kernand0</dc:creator>
      <dc:date>2021-08-05T13:26:38Z</dc:date>
    </item>
  </channel>
</rss>

