<?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: Calculated Data Model Field Value Inaccessible in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Calculated-Data-Model-Field-Value-Inaccessible/m-p/357050#M3046</link>
    <description>&lt;P&gt;For anyone else with the same problem, it appears that doing comparisons against the actual value of a data model field requires you to use enclosing $s to get the value rather than the variable reference.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Dec 2017 23:21:54 GMT</pubDate>
    <dc:creator>joeldavideng</dc:creator>
    <dc:date>2017-12-26T23:21:54Z</dc:date>
    <item>
      <title>Calculated Data Model Field Value Inaccessible</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Calculated-Data-Model-Field-Value-Inaccessible/m-p/357046#M3042</link>
      <description>&lt;P&gt;I created a data model called "Process_Creation" with a calculated field that represents the length of a specific string in the modeled events called "command_line_length". I can display the correct values for each event using a table command with "Process_Creation.command_line_length", however that seems to be all I can do with the data model field. When I attempt to compare the value to any numerical value I get zero results no matter the comparison type. &lt;/P&gt;

&lt;P&gt;The calculated field is stored as a number and the values are correct so I suspect the "where" command is not referencing the actual stored value. Any ideas?&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
| datamodel Process_Monitoring Process_Creation search &lt;BR /&gt;
| eval threshold = [ | search index=summary "search_name=pm_command_line_length_stats" earliest=-90d@d latest=-1d@d | stats avg(command_line_length) AS command_line_average stdev(command_line_length) AS command_line_stdev &lt;BR /&gt;
| eval threshold = round(command_line_average + ( command_line_stdev * 6 ))&lt;BR /&gt;
| return $threshold ]&lt;BR /&gt;
| where Process_Creation.command_line_length &amp;gt; threshold&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:22:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Calculated-Data-Model-Field-Value-Inaccessible/m-p/357046#M3042</guid>
      <dc:creator>joeldavideng</dc:creator>
      <dc:date>2020-09-29T17:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Data Model Field Value Inaccessible</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Calculated-Data-Model-Field-Value-Inaccessible/m-p/357047#M3043</link>
      <description>&lt;P&gt;Hi @joeldavideng,&lt;/P&gt;

&lt;P&gt;To start diagnose the issue first try to search &lt;CODE&gt;| datamodel Process_Monitoring Process_Creation search | where Process_Creation.command_line_length &amp;gt; 0&lt;/CODE&gt; are you getting any result ?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Dec 2017 05:37:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Calculated-Data-Model-Field-Value-Inaccessible/m-p/357047#M3043</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2017-12-26T05:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Data Model Field Value Inaccessible</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Calculated-Data-Model-Field-Value-Inaccessible/m-p/357048#M3044</link>
      <description>&lt;P&gt;Performing that query threw a type error "Typechecking failed. The '&amp;gt;' operator received different types" which would indicate that the value is stored as the wrong type. I checked the data model and that field is explicitly set as a number. Is there an implicit cast when you reference the data model?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Dec 2017 22:45:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Calculated-Data-Model-Field-Value-Inaccessible/m-p/357048#M3044</guid>
      <dc:creator>joeldavideng</dc:creator>
      <dc:date>2017-12-26T22:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Data Model Field Value Inaccessible</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Calculated-Data-Model-Field-Value-Inaccessible/m-p/357049#M3045</link>
      <description>&lt;P&gt;I randomly decided to try adding some $'s to the field to see if I could extract the value of the field and it worked. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
| datamodel Process_Monitoring Process_Creation search | where $Process_Creation.command_line_length$ &amp;gt; 100 &lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I guess the calculated fields in a data model behave differently than adhoc fields calculated at search time in a query. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:22:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Calculated-Data-Model-Field-Value-Inaccessible/m-p/357049#M3045</guid>
      <dc:creator>joeldavideng</dc:creator>
      <dc:date>2020-09-29T17:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Data Model Field Value Inaccessible</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Calculated-Data-Model-Field-Value-Inaccessible/m-p/357050#M3046</link>
      <description>&lt;P&gt;For anyone else with the same problem, it appears that doing comparisons against the actual value of a data model field requires you to use enclosing $s to get the value rather than the variable reference.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Dec 2017 23:21:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Calculated-Data-Model-Field-Value-Inaccessible/m-p/357050#M3046</guid>
      <dc:creator>joeldavideng</dc:creator>
      <dc:date>2017-12-26T23:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Data Model Field Value Inaccessible</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Calculated-Data-Model-Field-Value-Inaccessible/m-p/357051#M3047</link>
      <description>&lt;P&gt;@joeldavideng, can you add the final query that worked for you in your answer as well?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 03:14:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Calculated-Data-Model-Field-Value-Inaccessible/m-p/357051#M3047</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-12-27T03:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Data Model Field Value Inaccessible</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Calculated-Data-Model-Field-Value-Inaccessible/m-p/357052#M3048</link>
      <description>&lt;P&gt;Sure thing, it was very close to the original.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
 | datamodel Process_Monitoring Process_Creation search | eval threshold = [ | search index=summary "search_name=pm_command_line_length_stats" earliest=-90d@d latest=-1d@d | stats avg(command_line_length) AS command_line_average stdev(command_line_length) AS command_line_stdev | eval threshold = round(command_line_average + ( command_line_stdev * 6 )) | return $threshold ] | where $Process_Creation.command_line_length$ &amp;gt; threshold &lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:22:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Calculated-Data-Model-Field-Value-Inaccessible/m-p/357052#M3048</guid>
      <dc:creator>joeldavideng</dc:creator>
      <dc:date>2020-09-29T17:22:32Z</dc:date>
    </item>
  </channel>
</rss>

