<?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 extract key value pairs from JSON with a variable key through HTTP Event Collector? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-key-value-pairs-from-JSON-with-a-variable-key/m-p/500654#M85307</link>
    <description>&lt;P&gt;maybe, your log is &lt;EM&gt;one line&lt;/EM&gt; &lt;BR /&gt;
use &lt;CODE&gt;Show as raw text&lt;/CODE&gt; and provide them.&lt;/P&gt;

&lt;P&gt;and in your json-like log , &lt;CODE&gt;"Patch":&lt;/CODE&gt; is array &lt;CODE&gt;[&lt;/CODE&gt; , isn't it?&lt;/P&gt;</description>
    <pubDate>Wed, 20 May 2020 02:46:37 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-05-20T02:46:37Z</dc:date>
    <item>
      <title>How to extract key value pairs from JSON with a variable key through HTTP Event Collector?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-key-value-pairs-from-JSON-with-a-variable-key/m-p/500653#M85306</link>
      <description>&lt;P&gt;I need help with the following JSON format which is coming from HTTP Event Collector. I want to extract &lt;CODE&gt;Status&lt;/CODE&gt;, &lt;CODE&gt;Severity&lt;/CODE&gt;, &lt;CODE&gt;Id&lt;/CODE&gt; and &lt;CODE&gt;PatchState&lt;/CODE&gt; from the following JSON format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;{
    "relatedEvents": [],
    "relationships": [
        {
            "resourceId": "REDACTED
            "resourceType": "AWS::SSM::ManagedInstanceInventory",
            "name": "Is associated with "
        }
    ],
    "configuration": {
        "AWS:ComplianceItem": {
            "SchemaVersion": "1.0",
            "Content": {
                "Patch": {
                    "SomeValue": {
                        "Status": "NON_COMPLIANT",
                        "InstalledTime": "",
                        "ExecutionType": "Command",
                        "PatchSeverity": "",
                        "Title": "AAAAAAAA",
                        "Severity": "UNSPECIFIED",
                        "ComplianceType": "Patch",
                        "Classification": "",
                        "DocumentVersion": "",
                        "Id": "BBBBB",
                        "PatchState": "Missing",
                        "PatchBaselineId": "pb-xxxxxxxxxxxxxxxx",
                        "DocumentName": "",
                        "PatchGroup": ""
                    },
                    "SomeOtherValue": {
                        "Status": "NON_COMPLIANT",
                        "InstalledTime": "",
                        "ExecutionType": "Command",
                        "PatchSeverity": "",
                        "Title": "CCCCCCCC",
                        "Severity": "UNSPECIFIED",
                        "ComplianceType": "Patch",
                        "Classification": "",
                        "DocumentVersion": "",
                        "Id": "AAAAAAA",
                        "PatchState": "Missing",
                        "PatchBaselineId": "pb-xxxxxxx",
                        "DocumentName": "",
                        "PatchGroup": ""
                    },
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please note that the embedded nesting's 4th element is a variable (usually a package name) so it is hard to parse using spath and I do not have a fixed number of the 4th nested JSON objects I receive.&lt;/P&gt;
&lt;P&gt;Please help and thanks in advance.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jun 2020 01:06:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-key-value-pairs-from-JSON-with-a-variable-key/m-p/500653#M85306</guid>
      <dc:creator>cloudshowbob</dc:creator>
      <dc:date>2020-06-07T01:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract key value pairs from JSON with a variable key through HTTP Event Collector?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-key-value-pairs-from-JSON-with-a-variable-key/m-p/500654#M85307</link>
      <description>&lt;P&gt;maybe, your log is &lt;EM&gt;one line&lt;/EM&gt; &lt;BR /&gt;
use &lt;CODE&gt;Show as raw text&lt;/CODE&gt; and provide them.&lt;/P&gt;

&lt;P&gt;and in your json-like log , &lt;CODE&gt;"Patch":&lt;/CODE&gt; is array &lt;CODE&gt;[&lt;/CODE&gt; , isn't it?&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 02:46:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-key-value-pairs-from-JSON-with-a-variable-key/m-p/500654#M85307</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-20T02:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract key value pairs from JSON with a variable key through HTTP Event Collector?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-key-value-pairs-from-JSON-with-a-variable-key/m-p/500655#M85308</link>
      <description>&lt;P&gt;I am giving a subset, the raw json is like 10k+ lines. There are no arrays just embedded json objects&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 17:26:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-key-value-pairs-from-JSON-with-a-variable-key/m-p/500655#M85308</guid>
      <dc:creator>cloudshowbob</dc:creator>
      <dc:date>2020-05-20T17:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract key value pairs from JSON with a variable key through HTTP Event Collector?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-key-value-pairs-from-JSON-with-a-variable-key/m-p/500656#M85309</link>
      <description>&lt;P&gt;there is the array &lt;CODE&gt;relationships&lt;/CODE&gt; in your sample.&lt;/P&gt;

&lt;P&gt;good luck.&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 21:04:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-key-value-pairs-from-JSON-with-a-variable-key/m-p/500656#M85309</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-20T21:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract key value pairs from JSON with a variable key through HTTP Event Collector?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-key-value-pairs-from-JSON-with-a-variable-key/m-p/500657#M85310</link>
      <description>&lt;P&gt;Do an EXTRACT in props.conf that completely ignores the fact that it's JSON &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; e.g.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[foo]
EXTRACT-PatchState = "PatchState: \"(?&amp;lt;PatchState&amp;gt;[^\"]+)\","
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 May 2020 21:00:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-key-value-pairs-from-JSON-with-a-variable-key/m-p/500657#M85310</guid>
      <dc:creator>ruman_splunk</dc:creator>
      <dc:date>2020-05-28T21:00:07Z</dc:date>
    </item>
  </channel>
</rss>

