<?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 Extraction of Data in JSON Message Inexplicably Not Working in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Extraction-of-Data-in-JSON-Message-Inexplicably-Not-Working/m-p/550867#M5020</link>
    <description>&lt;P&gt;I'm at my wits end here, everything seems to indicate what I'm doing should work, yet it's not.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have Azure firewall logs feeding in through a storage account using the Microsoft Cloud Services app. These come in as standard JSON, which is being extracted fine by Splunk. There is a nested field in the JSON, "properties.msg", that has the actual firewall log message including source/destination information, IPs/ports, whether it was allowed/denied, and what firewall rule was referenced.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;For reference, this thread discusses a nearly similar case/problem -&lt;A href="https://community.splunk.com/t5/Splunk-Search/Azure-Firewall-Log-Field-Extraction-Help/m-p/411148" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Splunk-Search/Azure-Firewall-Log-Field-Extraction-Help/m-p/411148&amp;nbsp;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The added wrinkle I have is that I am trying to get the fields extracted to work with CIM data models, not just get&amp;nbsp; the extractions as results from a search. This honestly seemed easy enough, but for some reason none of my field extractions are working.&lt;BR /&gt;&lt;BR /&gt;Here are some facts/things I have tried&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;This is in Splunk Cloud&lt;/LI&gt;&lt;LI&gt;I created a regex to extract all the fields from the properties.msg to named capture groups&lt;/LI&gt;&lt;LI&gt;The regex shows correct in Regex101&lt;/LI&gt;&lt;LI&gt;The regex extracts all the fields if used in the 'rex' command in search&lt;/LI&gt;&lt;LI&gt;Using the regex inside the Field Extractor tool and checking with preview function shows the fields extracted&lt;/LI&gt;&lt;LI&gt;I've saved the extraction as being shared Globally, Private, and App only (even tried different apps other than search)&lt;/LI&gt;&lt;LI&gt;I've tried saving as a inline extraction, and as a transform applying to both the _raw and individual properties.msg as SOURCE_KEY&lt;/LI&gt;&lt;LI&gt;I'm not seeing any errors or warnings when trying to do any of these changes that would make me thing something was wrong&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;None of this seems to work, none of the fields are extracted.&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;I tried doing a field alias for 'properties.msg' to 'msg', and that worked so it's not like its&amp;nbsp; (but didn't help me because I still can't extract the data from within that message.)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I honestly don't get how I can see the regex working in the Field Extractor, hit 'Save', see it saved in the configurations, but not extract fields.&lt;BR /&gt;&lt;BR /&gt;EDIT:&lt;BR /&gt;Sample _raw log (more in updated link posted above)&lt;BR /&gt;{ "category": "AzureFirewallApplicationRule", "time": "2021-05-04T15:41:59.8967610Z", "resourceId": "/SUBSCRIPTIONS/REDACTED/RESOURCEGROUPS/REDACTED/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/SOMEFW", "operationName": "AzureFirewallApplicationRuleLog", "properties": {"msg":"HTTPS request from 192.168.0.1:8888 to subdomain.x99.blob.storage.azure.net:443. Action: Allow. Rule Collection: AllowOutbound. Rule: AllowOutbound-AA-AA-A"}}&lt;BR /&gt;{ "category": "AzureFirewallApplicationRule", "time": "2021-05-04T15:41:58.6369780Z", "resourceId": "/SUBSCRIPTIONS/REDACTED/RESOURCEGROUPS/REDACTED/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/SOMEFW", "operationName": "AzureFirewallApplicationRuleLog", "properties": {"msg":"HTTPS request from 192.168.0.1:8888 to subdomain.x99.blob.storage.azure.net:443. Action: Allow. Rule Collection: AllowOutbound. Rule: AllowOutbound-AA-AA-A"}}&lt;BR /&gt;{ "category": "AzureFirewallNetworkRule", "time": "2021-05-07T15:05:59.8277330Z", "resourceId": "/SUBSCRIPTIONS/REDACTED/RESOURCEGROUPS/REDACTED/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/SOMEFW", "operationName": "AzureFirewallNetworkRuleLog", "properties": {"msg":"TCP request from 192.168.0.1:8888 to 8.8.8.8:8888. Action: Deny. "}}&lt;BR /&gt;&lt;BR /&gt;Regex&lt;BR /&gt;\"(?&amp;lt;protocol&amp;gt;\w+)\s[rR]equest\D+(?&amp;lt;src&amp;gt;[^\:]+)\:(?&amp;lt;src_port&amp;gt;\d+) to (?&amp;lt;dest&amp;gt;[^\:]+)\:((?&amp;lt;dest_port&amp;gt;\d+))?\.\sAction\: (?&amp;lt;action&amp;gt;\w+)\.(?: Rule Collection\: (?&amp;lt;cat&amp;gt;\w+)\. Rule\: (?&amp;lt;rule&amp;gt;[^\"]+))?&lt;/P&gt;</description>
    <pubDate>Fri, 07 May 2021 17:45:28 GMT</pubDate>
    <dc:creator>Sivrat</dc:creator>
    <dc:date>2021-05-07T17:45:28Z</dc:date>
    <item>
      <title>Extraction of Data in JSON Message Inexplicably Not Working</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Extraction-of-Data-in-JSON-Message-Inexplicably-Not-Working/m-p/550867#M5020</link>
      <description>&lt;P&gt;I'm at my wits end here, everything seems to indicate what I'm doing should work, yet it's not.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have Azure firewall logs feeding in through a storage account using the Microsoft Cloud Services app. These come in as standard JSON, which is being extracted fine by Splunk. There is a nested field in the JSON, "properties.msg", that has the actual firewall log message including source/destination information, IPs/ports, whether it was allowed/denied, and what firewall rule was referenced.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;For reference, this thread discusses a nearly similar case/problem -&lt;A href="https://community.splunk.com/t5/Splunk-Search/Azure-Firewall-Log-Field-Extraction-Help/m-p/411148" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Splunk-Search/Azure-Firewall-Log-Field-Extraction-Help/m-p/411148&amp;nbsp;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The added wrinkle I have is that I am trying to get the fields extracted to work with CIM data models, not just get&amp;nbsp; the extractions as results from a search. This honestly seemed easy enough, but for some reason none of my field extractions are working.&lt;BR /&gt;&lt;BR /&gt;Here are some facts/things I have tried&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;This is in Splunk Cloud&lt;/LI&gt;&lt;LI&gt;I created a regex to extract all the fields from the properties.msg to named capture groups&lt;/LI&gt;&lt;LI&gt;The regex shows correct in Regex101&lt;/LI&gt;&lt;LI&gt;The regex extracts all the fields if used in the 'rex' command in search&lt;/LI&gt;&lt;LI&gt;Using the regex inside the Field Extractor tool and checking with preview function shows the fields extracted&lt;/LI&gt;&lt;LI&gt;I've saved the extraction as being shared Globally, Private, and App only (even tried different apps other than search)&lt;/LI&gt;&lt;LI&gt;I've tried saving as a inline extraction, and as a transform applying to both the _raw and individual properties.msg as SOURCE_KEY&lt;/LI&gt;&lt;LI&gt;I'm not seeing any errors or warnings when trying to do any of these changes that would make me thing something was wrong&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;None of this seems to work, none of the fields are extracted.&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;I tried doing a field alias for 'properties.msg' to 'msg', and that worked so it's not like its&amp;nbsp; (but didn't help me because I still can't extract the data from within that message.)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I honestly don't get how I can see the regex working in the Field Extractor, hit 'Save', see it saved in the configurations, but not extract fields.&lt;BR /&gt;&lt;BR /&gt;EDIT:&lt;BR /&gt;Sample _raw log (more in updated link posted above)&lt;BR /&gt;{ "category": "AzureFirewallApplicationRule", "time": "2021-05-04T15:41:59.8967610Z", "resourceId": "/SUBSCRIPTIONS/REDACTED/RESOURCEGROUPS/REDACTED/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/SOMEFW", "operationName": "AzureFirewallApplicationRuleLog", "properties": {"msg":"HTTPS request from 192.168.0.1:8888 to subdomain.x99.blob.storage.azure.net:443. Action: Allow. Rule Collection: AllowOutbound. Rule: AllowOutbound-AA-AA-A"}}&lt;BR /&gt;{ "category": "AzureFirewallApplicationRule", "time": "2021-05-04T15:41:58.6369780Z", "resourceId": "/SUBSCRIPTIONS/REDACTED/RESOURCEGROUPS/REDACTED/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/SOMEFW", "operationName": "AzureFirewallApplicationRuleLog", "properties": {"msg":"HTTPS request from 192.168.0.1:8888 to subdomain.x99.blob.storage.azure.net:443. Action: Allow. Rule Collection: AllowOutbound. Rule: AllowOutbound-AA-AA-A"}}&lt;BR /&gt;{ "category": "AzureFirewallNetworkRule", "time": "2021-05-07T15:05:59.8277330Z", "resourceId": "/SUBSCRIPTIONS/REDACTED/RESOURCEGROUPS/REDACTED/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/SOMEFW", "operationName": "AzureFirewallNetworkRuleLog", "properties": {"msg":"TCP request from 192.168.0.1:8888 to 8.8.8.8:8888. Action: Deny. "}}&lt;BR /&gt;&lt;BR /&gt;Regex&lt;BR /&gt;\"(?&amp;lt;protocol&amp;gt;\w+)\s[rR]equest\D+(?&amp;lt;src&amp;gt;[^\:]+)\:(?&amp;lt;src_port&amp;gt;\d+) to (?&amp;lt;dest&amp;gt;[^\:]+)\:((?&amp;lt;dest_port&amp;gt;\d+))?\.\sAction\: (?&amp;lt;action&amp;gt;\w+)\.(?: Rule Collection\: (?&amp;lt;cat&amp;gt;\w+)\. Rule\: (?&amp;lt;rule&amp;gt;[^\"]+))?&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 17:45:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Extraction-of-Data-in-JSON-Message-Inexplicably-Not-Working/m-p/550867#M5020</guid>
      <dc:creator>Sivrat</dc:creator>
      <dc:date>2021-05-07T17:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction of Data in JSON Message Inexplicably Not Working</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Extraction-of-Data-in-JSON-Message-Inexplicably-Not-Working/m-p/550878#M5021</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Is it possible you to provide some sample data (Please redact any sensitive data) and also provide regex which you are using.&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 17:17:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Extraction-of-Data-in-JSON-Message-Inexplicably-Not-Working/m-p/550878#M5021</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2021-05-07T17:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction of Data in JSON Message Inexplicably Not Working</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Extraction-of-Data-in-JSON-Message-Inexplicably-Not-Working/m-p/550887#M5022</link>
      <description>&lt;P&gt;I've added some samples and my regex to the original post, and updated the link to point to&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Splunk-Search/Azure-Firewall-Log-Field-Extraction-Help/m-p/411148" target="_blank"&gt;https://community.splunk.com/t5/Splunk-Search/Azure-Firewall-Log-Field-Extraction-Help/m-p/411148&lt;/A&gt;&amp;nbsp;which also has some additional examples if needed.&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 17:43:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Extraction-of-Data-in-JSON-Message-Inexplicably-Not-Working/m-p/550887#M5022</guid>
      <dc:creator>Sivrat</dc:creator>
      <dc:date>2021-05-07T17:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction of Data in JSON Message Inexplicably Not Working</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Extraction-of-Data-in-JSON-Message-Inexplicably-Not-Working/m-p/550894#M5023</link>
      <description>&lt;P&gt;For me it is working with Field Extraction and Field transformation. Main things you need to keep in mind that your sourcetype must have KV_MODE = json otherwise below configuration will not work.&lt;BR /&gt;&lt;BR /&gt;Used your regex but removed starting \"&lt;/P&gt;&lt;P&gt;Regex:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(?&amp;lt;protocol&amp;gt;\w+)\s[rR]equest\D+(?&amp;lt;src&amp;gt;[^\:]+)\:(?&amp;lt;src_port&amp;gt;\d+) to (?&amp;lt;dest&amp;gt;[^\:]+)\:((?&amp;lt;dest_port&amp;gt;\d+))?\.\sAction\: (?&amp;lt;action&amp;gt;\w+)\.(?: Rule Collection\: (?&amp;lt;cat&amp;gt;\w+)\. Rule\: (?&amp;lt;rule&amp;gt;[^\"]+))?&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Field Transformation" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14085i03AA9962DFC805E7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2021-05-07 at 7.08.49 PM.png" alt="Field Transformation" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Field Transformation&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Field Extraction" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14086i17BD6D366B65C00D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2021-05-07 at 7.09.42 PM.png" alt="Field Extraction" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Field Extraction&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 18:11:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Extraction-of-Data-in-JSON-Message-Inexplicably-Not-Working/m-p/550894#M5023</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2021-05-07T18:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction of Data in JSON Message Inexplicably Not Working</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Extraction-of-Data-in-JSON-Message-Inexplicably-Not-Working/m-p/550910#M5026</link>
      <description>&lt;P&gt;Thanks for your response.&lt;BR /&gt;&lt;BR /&gt;I don't think I can confirm the KV_MODE of the sourcetype easily in Splunk Cloud, but I'll look. Definitely seems like it's doing automatic KV extraction, but that could be misleading.&lt;BR /&gt;&lt;BR /&gt;However, according to this -&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/latest/Knowledge/Searchtimeoperationssequence" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/latest/Knowledge/Searchtimeoperationssequence&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The KV_MODE would apply after the both inline and transform based extractions, doesn't it? I had tried specifying properties.msg as the SOURCE_KEY before, and when it didn't work for me I assumed it was due to that, and tried just using _raw (which is why the "s were there to help the regex) to no avail.&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 20:40:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Extraction-of-Data-in-JSON-Message-Inexplicably-Not-Working/m-p/550910#M5026</guid>
      <dc:creator>Sivrat</dc:creator>
      <dc:date>2021-05-07T20:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction of Data in JSON Message Inexplicably Not Working</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Extraction-of-Data-in-JSON-Message-Inexplicably-Not-Working/m-p/551236#M5042</link>
      <description>&lt;P&gt;Used API to set the KV Mode to JSON, put in details exactly as specified and appears to be working in other environments, still not working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seeing same issue with another non-json source, where a single field extraction shows as extracted in the preview of the Field Extractor, but does not get extracted after saving that, regardless of sharing status.&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 12:49:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Extraction-of-Data-in-JSON-Message-Inexplicably-Not-Working/m-p/551236#M5042</guid>
      <dc:creator>Sivrat</dc:creator>
      <dc:date>2021-05-11T12:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction of Data in JSON Message Inexplicably Not Working</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Extraction-of-Data-in-JSON-Message-Inexplicably-Not-Working/m-p/551339#M5045</link>
      <description>&lt;P&gt;I am confused now, JSON events which was not extracting fields at search time is working now ??&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2021 11:34:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Extraction-of-Data-in-JSON-Message-Inexplicably-Not-Working/m-p/551339#M5045</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2021-05-12T11:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction of Data in JSON Message Inexplicably Not Working</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Extraction-of-Data-in-JSON-Message-Inexplicably-Not-Working/m-p/551348#M5046</link>
      <description>&lt;P&gt;I am confused as well, but apparently this is resolved.&lt;BR /&gt;&lt;BR /&gt;The issue I was seeing with JSON events originally described also was with some other, non-JSON events.&lt;BR /&gt;&lt;BR /&gt;I opened a ticket with support. They, like you, created one of the extractions without issue on the AdHoc Splunk Cloud SH. I was able to create another on the AdHoc SH, but to line up with the data models I had been trying to use the ES Search Head.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;After that, the previous extractions I had created on the ES Search Head seemed to start working. Not sure if something changed, or if I had just been impatient previously and not letting the extraction enough time to apply.&lt;BR /&gt;&lt;BR /&gt;So things are resolved now, and I don't understand why. But things are working as intended.&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2021 13:07:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Extraction-of-Data-in-JSON-Message-Inexplicably-Not-Working/m-p/551348#M5046</guid>
      <dc:creator>Sivrat</dc:creator>
      <dc:date>2021-05-12T13:07:22Z</dc:date>
    </item>
  </channel>
</rss>

