<?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: | pivot and eval in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/pivot-and-eval/m-p/163780#M46526</link>
    <description>&lt;P&gt;thanks again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;However, the whole reason for me to play with datamodels in the first place was to make use of the acceleration feature. It seems to me that what I want to do is just not possible with the pivot command, at least for now.. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Dec 2013 07:50:19 GMT</pubDate>
    <dc:creator>anjafischer</dc:creator>
    <dc:date>2013-12-05T07:50:19Z</dc:date>
    <item>
      <title>| pivot and eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/pivot-and-eval/m-p/163775#M46521</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;

&lt;P&gt;is there any way to combine table creation using an eval expression in combination with the accelerated pivot command?&lt;/P&gt;

&lt;P&gt;What i am looking for is a query similar to this, which, unfortunately, does not work:&lt;BR /&gt;
| pivot Test123 CICS_Root eval(sum(cputot)/sum(count)) as average splitrow _time&lt;/P&gt;

&lt;P&gt;Writing a normal search query without making use of accelerated datamodels works just fine with the eval, but pivot searches don't and I just don't see how to make it work... &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Also, I thoughht that maybe i could create an eval attribute for my datamodel, but I can't for the expression above, it needs to calculate both sums over the specified time range and only THEN divide them. Any ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2013 09:03:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/pivot-and-eval/m-p/163775#M46521</guid>
      <dc:creator>anjafischer</dc:creator>
      <dc:date>2013-12-03T09:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: | pivot and eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/pivot-and-eval/m-p/163776#M46522</link>
      <description>&lt;P&gt;Try creating three eval attributes for your data model that are listed in this order:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;An eval attribute named &lt;CODE&gt;sumcpuot&lt;/CODE&gt; that is defined with the expression &lt;CODE&gt;sum(cpuot)&lt;/CODE&gt;.&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;An eval attribute named &lt;CODE&gt;sumcount&lt;/CODE&gt; that is defined with the expression &lt;CODE&gt;sum(count)&lt;/CODE&gt;.&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;An eval attribute named &lt;CODE&gt;average_splitrow_time&lt;/CODE&gt; that is defined with the expression &lt;CODE&gt;sumcpuot/sumcount&lt;/CODE&gt;.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;The order is important, as Splunk process the attributes from top to bottom. &lt;/P&gt;

&lt;P&gt;Then you could create pivots that use that &lt;CODE&gt;average_splitrow_time&lt;/CODE&gt; attribute in their calculations.&lt;/P&gt;

&lt;P&gt;For more info, &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Designdatamodelobjects#Add_an_eval_expression_attribute_to_your_object"&gt;see the docs&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2013 18:07:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/pivot-and-eval/m-p/163776#M46522</guid>
      <dc:creator>mattness</dc:creator>
      <dc:date>2013-12-03T18:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: | pivot and eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/pivot-and-eval/m-p/163777#M46523</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;thanks for your suggestion. However, either it does not work or I am too stupid to make it work &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Within the data model definition, I clicked "add eval expression". Now, what do I type for the actual eval expression? "sum(cputot)", "eval(sum(cputot))", "eval sumcputot=sum(cputot)"?&lt;/P&gt;

&lt;P&gt;None of these work, splunk always complains thatthe operator is not supported. Besides, "sum" is not listed as a valid eval function...&lt;/P&gt;

&lt;P&gt;What am I doing wrong here?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2013 07:29:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/pivot-and-eval/m-p/163777#M46523</guid>
      <dc:creator>anjafischer</dc:creator>
      <dc:date>2013-12-04T07:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: | pivot and eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/pivot-and-eval/m-p/163778#M46524</link>
      <description>&lt;P&gt;Yeah, you're right--&lt;CODE&gt;sum&lt;/CODE&gt; is unsupported as an operator for &lt;CODE&gt;eval&lt;/CODE&gt;. My mistake--I should have checked. Maybe you could show me the original search query that you're trying to duplicate? I'm not sure that the &lt;CODE&gt;eval&lt;/CODE&gt; expression that you have in your original question would have worked either, since you use &lt;CODE&gt;sum&lt;/CODE&gt; as well. You'd have to include &lt;CODE&gt;stats&lt;/CODE&gt; or some other transforming command to make it work, I think.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Search/Usestatswithevalexpressionsandfunctions"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Search/Usestatswithevalexpressionsandfunctions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2013 18:02:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/pivot-and-eval/m-p/163778#M46524</guid>
      <dc:creator>mattness</dc:creator>
      <dc:date>2013-12-04T18:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: | pivot and eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/pivot-and-eval/m-p/163779#M46525</link>
      <description>&lt;P&gt;Ok, second try here...consider creating a new datamodel with a root search object that is defined with a search that includes:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;...| stats sum(cputot) AS sumcputot, sum(count) AS sumcount&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;And then create an eval attribute for the object named &lt;CODE&gt;average_splitrow_time&lt;/CODE&gt; with the definition &lt;CODE&gt;sumcputot/sumcount&lt;/CODE&gt;. (you only need the eval expression in the &lt;STRONG&gt;Eval Expression&lt;/STRONG&gt; field, you do not to include &lt;CODE&gt;eval&lt;/CODE&gt; or the eval fieldname)&lt;/P&gt;

&lt;P&gt;The primary problem with this solution is that you cannot accelerate data models based on search objects.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2013 18:30:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/pivot-and-eval/m-p/163779#M46525</guid>
      <dc:creator>mattness</dc:creator>
      <dc:date>2013-12-04T18:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: | pivot and eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/pivot-and-eval/m-p/163780#M46526</link>
      <description>&lt;P&gt;thanks again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;However, the whole reason for me to play with datamodels in the first place was to make use of the acceleration feature. It seems to me that what I want to do is just not possible with the pivot command, at least for now.. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2013 07:50:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/pivot-and-eval/m-p/163780#M46526</guid>
      <dc:creator>anjafischer</dc:creator>
      <dc:date>2013-12-05T07:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: | pivot and eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/pivot-and-eval/m-p/163781#M46527</link>
      <description>&lt;P&gt;Yeah...at the moment it's just not possible to pull off this particular computation in an accelerated data model. I learned yesterday that the Splunk dev team is considering putting this functionality into a future release, however...so stay tuned.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2013 18:26:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/pivot-and-eval/m-p/163781#M46527</guid>
      <dc:creator>mattness</dc:creator>
      <dc:date>2013-12-05T18:26:45Z</dc:date>
    </item>
  </channel>
</rss>

