<?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: Spath calculated field limitations in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Spath-calculated-field-limitations/m-p/536388#M4887</link>
    <description>&lt;P&gt;try SEDCMD in props.conf ,also&lt;/P&gt;&lt;P&gt;SEDCMD-trim = s/\\\//g&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jan 2021 21:10:35 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2021-01-19T21:10:35Z</dc:date>
    <item>
      <title>Spath calculated field limitations</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Spath-calculated-field-limitations/m-p/535730#M4877</link>
      <description>&lt;P&gt;Hey Splunkers!&lt;/P&gt;&lt;P&gt;We are running into an issue with an on-prem distributed deployment where the AWS feed is not extracting nested JSON fields at search time without the use of spath. We get first level and partial second level auto extraction, but it stops there. We need to normalize this data for functionality with friendly name alias's, and would like to avoid end users having to use spath with a long rename macro. yes, KV_MODE is set to JSON on the SH, IDX, and HF. no, we'd rather not perform indexed extractions. We've upped several limits and are unsure why it wouldn't just auto extract at searchtime. Please halp!&lt;/P&gt;&lt;P&gt;Here is the issue with using spath in calculated fields as a work around. I can calculate version and id consistently, but next level nested values with lists do not calculate to return fields at search-time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;works -&amp;gt; aws : EVAL-version version spath('BodyJson.Message', "version")&lt;/P&gt;&lt;P&gt;works -&amp;gt; aws : EVAL-id id spath('BodyJson.Message', "id")&lt;/P&gt;&lt;P&gt;doesn't work -&amp;gt;&amp;nbsp;aws : EVAL-resources resources spath('BodyJson.Message', 'resources{}')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BodyJson: {&lt;BR /&gt;Message: {"version":"0","id":"-e154-88b-c","detail-type":"Findings - Imported","source":"aws.","account":"4724","time":"2021-01-13T20:09:26Z","region":"ca-central-1","resources":["arn:aws:ca"],"detail":{"findings":[{"ProductArn":"arn:aws:"...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong here? Also, is there a known limitation on how many cycles of spath calculations the system will run on a specific field? Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 22:37:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Spath-calculated-field-limitations/m-p/535730#M4877</guid>
      <dc:creator>Aatom</dc:creator>
      <dc:date>2021-01-13T22:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Spath calculated field limitations</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Spath-calculated-field-limitations/m-p/536087#M4884</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=_internal | head 1 | fields _raw
| eval _raw="{\"BodyJson\":{\"Message\":{\"version\":\"0\",\"id\":\"-e154-88b-c\",\"detail-type\":\"Findings - \\\"Imported\\\"\",\"source\":\"aws.\",\"account\":\"4724\",\"time\":\"2021-01-13T20:09:26Z\",\"region\":\"ca-central-1\",\"resources\":[\"arn:aws:ca\"],\"detail\":{\"findings\":[{\"ProductArn\":\"arn:aws:\"}]}}}}"
| eval resources=json_extract(_raw,'BodyJson.Message','resources{}')&lt;/LI-CODE&gt;&lt;P&gt;["&lt;STRONG&gt;arn:aws:ca"&lt;/STRONG&gt;]&lt;BR /&gt;It seems to be extracted incorrectly.It's a bug.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal | head 1 | fields _raw
| eval _raw="{\"BodyJson\":{\"Message\":{\"version\":\"0\",\"id\":\"-e154-88b-c\",\"detail-type\":\"Findings - \\\"Imported\\\"\",\"source\":\"aws.\",\"account\":\"4724\",\"time\":\"2021-01-13T20:09:26Z\",\"region\":\"ca-central-1\",\"resources\":[\"arn:aws:ca\"],\"detail\":{\"findings\":[{\"ProductArn\":\"arn:aws:\"}]}}}}"
| rex mode=sed "s/resources\":\[(.*?)\]/resources\": \1/"
| spath&lt;/LI-CODE&gt;&lt;P&gt;How about SEDCMD?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 23:55:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Spath-calculated-field-limitations/m-p/536087#M4884</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2021-01-15T23:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Spath calculated field limitations</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Spath-calculated-field-limitations/m-p/536385#M4886</link>
      <description>&lt;P&gt;Thanks for the quick reply &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/184221"&gt;@to4kawa&lt;/a&gt;&amp;nbsp;. I think this is part of the issue... The _raw output has the nested JSON objects escaping quotes with a backslash under &lt;STRONG&gt;Message&lt;/STRONG&gt;. Is my best bet to setup a props/transforms on the SH to replace \" with " ? Are there any working examples you could point me towards? Thanks!&lt;/P&gt;&lt;P&gt;"BodyJson": {"Type": "Notification", "MessageId": "4f8b9202e", "TopicArn": "arn:aws:sns:ap-south-1:6679786758:events-ap-south-1", "&lt;STRONG&gt;Message&lt;/STRONG&gt;": "{&lt;STRONG&gt;\"&lt;/STRONG&gt;version&lt;STRONG&gt;\"&lt;/STRONG&gt;:&lt;STRONG&gt;\"&lt;/STRONG&gt;0&lt;STRONG&gt;\"&lt;/STRONG&gt;,&lt;STRONG&gt;\"&lt;/STRONG&gt;id&lt;STRONG&gt;\"&lt;/STRONG&gt;:&lt;STRONG&gt;\"&lt;/STRONG&gt;0a880&lt;STRONG&gt;\"&lt;/STRONG&gt;,&lt;STRONG&gt;\"&lt;/STRONG&gt;detail-type&lt;STRONG&gt;\"&lt;/STRONG&gt;:&lt;STRONG&gt;\"&lt;/STRONG&gt;Findings - Imported&lt;STRONG&gt;\"&lt;/STRONG&gt;,&lt;STRONG&gt;\"&lt;/STRONG&gt;source&lt;STRONG&gt;\"&lt;/STRONG&gt;:&lt;STRONG&gt;\"&lt;/STRONG&gt;aws&lt;STRONG&gt;\"&lt;/STRONG&gt;,&lt;STRONG&gt;\"&lt;/STRONG&gt;account&lt;STRONG&gt;\"&lt;/STRONG&gt;:&lt;STRONG&gt;\"&lt;/STRONG&gt;56565&lt;STRONG&gt;\"&lt;/STRONG&gt;,&lt;STRONG&gt;\"&lt;/STRONG&gt;time&lt;STRONG&gt;\"&lt;/STRONG&gt;:&lt;STRONG&gt;\"&lt;/STRONG&gt;2021-01-19T20:26:38Z&lt;STRONG&gt;\"&lt;/STRONG&gt;,&lt;STRONG&gt;\"&lt;/STRONG&gt;region&lt;STRONG&gt;\"&lt;/STRONG&gt;:&lt;STRONG&gt;\"&lt;/STRONG&gt;ap-south-1&lt;STRONG&gt;\",\"&lt;/STRONG&gt;resources&lt;STRONG&gt;\"&lt;/STRONG&gt;:[&lt;STRONG&gt;\"&lt;/STRONG&gt;arn:aws:ap-south-1::product/aws/arn:aws:securityhub:ap-south-1:102707:subscription/v/1.2.0/1.6/finding/cb7ac3afd&lt;STRONG&gt;\"&lt;/STRONG&gt;],&lt;STRONG&gt;\"&lt;/STRONG&gt;detail&lt;STRONG&gt;\"&lt;/STRONG&gt;:....&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 20:38:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Spath-calculated-field-limitations/m-p/536385#M4886</guid>
      <dc:creator>Aatom</dc:creator>
      <dc:date>2021-01-19T20:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Spath calculated field limitations</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Spath-calculated-field-limitations/m-p/536388#M4887</link>
      <description>&lt;P&gt;try SEDCMD in props.conf ,also&lt;/P&gt;&lt;P&gt;SEDCMD-trim = s/\\\//g&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 21:10:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Spath-calculated-field-limitations/m-p/536388#M4887</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2021-01-19T21:10:35Z</dc:date>
    </item>
  </channel>
</rss>

