<?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 eval command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/eval-command/m-p/291699#M88115</link>
    <description>&lt;P&gt;Ok I'm feeling kinda stupid&lt;/P&gt;

&lt;P&gt;this query works&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wholesale_app buildTarget=comcast analyticType=SessionStart   |eval hardwaretype=Properties.platformData.HC|stats count by Properties.platformData.HC
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but this one dosen't&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wholesale_app buildTarget=comcast analyticType=SessionStart   |eval hardwaretype=Properties.platformData.HC|stats count by hardwaretype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Scratches head ------ what am I missing?&lt;/P&gt;</description>
    <pubDate>Mon, 20 Nov 2017 23:52:43 GMT</pubDate>
    <dc:creator>dbcase</dc:creator>
    <dc:date>2017-11-20T23:52:43Z</dc:date>
    <item>
      <title>eval command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-command/m-p/291699#M88115</link>
      <description>&lt;P&gt;Ok I'm feeling kinda stupid&lt;/P&gt;

&lt;P&gt;this query works&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wholesale_app buildTarget=comcast analyticType=SessionStart   |eval hardwaretype=Properties.platformData.HC|stats count by Properties.platformData.HC
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but this one dosen't&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wholesale_app buildTarget=comcast analyticType=SessionStart   |eval hardwaretype=Properties.platformData.HC|stats count by hardwaretype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Scratches head ------ what am I missing?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 23:52:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-command/m-p/291699#M88115</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2017-11-20T23:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: eval command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-command/m-p/291700#M88116</link>
      <description>&lt;P&gt;The fieldname you're using in stats in first query is &lt;CODE&gt;Properties.platformData.HC&lt;/CODE&gt; which exists and stats works. The eval here may not be doing anything as &lt;CODE&gt;|eval hardwaretype=Properties.platformData.HC&lt;/CODE&gt; is basically trying to concatenate values of fields &lt;CODE&gt;Properties&lt;/CODE&gt; with field &lt;CODE&gt;platformDate&lt;/CODE&gt; and field &lt;CODE&gt;HC&lt;/CODE&gt;. The dot there is treated as concatenation operator. Assuming you don't have fields Properties&lt;CODE&gt;,&lt;/CODE&gt;platformDate&lt;CODE&gt;and&lt;/CODE&gt;HC&lt;CODE&gt;in  your data, the eval fails to populate field hardware type. That's why the second search failed. &lt;BR /&gt;
You should either use the field&lt;/CODE&gt;Properties.platformData.HC&lt;CODE&gt;in your stats like query 1 OR enclose the&lt;/CODE&gt;Properties.platformData.HC` in single quotes in eval, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wholesale_app buildTarget=comcast analyticType=SessionStart    |eval hardwaretype='Properties.platformData.HC'|stats count by hardwaretype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Nov 2017 00:01:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-command/m-p/291700#M88116</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-11-21T00:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: eval command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-command/m-p/291701#M88117</link>
      <description>&lt;P&gt;When you take out the stats command, does &lt;CODE&gt;hardwaretype&lt;/CODE&gt; come back as a field with values?&lt;BR /&gt;
Can you try &lt;CODE&gt;|eval hardwaretype='Properties.platformData.HC'&lt;/CODE&gt; or &lt;CODE&gt;|rename "Properties.platformData.HC" as hardwaretype&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 00:03:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-command/m-p/291701#M88117</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-11-21T00:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: eval command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-command/m-p/291702#M88118</link>
      <description>&lt;P&gt;interesting so the dot has dual purpose?  Meaning the only way I know how to refer to a json object that has multiple levels is&lt;/P&gt;

&lt;P&gt;level1.level2.level3&lt;/P&gt;

&lt;P&gt;and the dot is used for concatenation as well&lt;/P&gt;

&lt;P&gt;thats not confusing at all &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thanks Somesoni2!!!  Saved large clumps of my hair &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 01:29:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-command/m-p/291702#M88118</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2017-11-21T01:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: eval command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-command/m-p/291703#M88119</link>
      <description>&lt;P&gt;Hi Cmerriman,&lt;/P&gt;

&lt;P&gt;without the single quotes hardware model just comes back as blank/null &lt;/P&gt;

&lt;P&gt;once the single quotes were added things started working as expected.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 01:50:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-command/m-p/291703#M88119</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2017-11-21T01:50:53Z</dc:date>
    </item>
  </channel>
</rss>

