<?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 Am I allowed to do an eval inside a sum when creating dashboards? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Am-I-allowed-to-do-an-eval-inside-a-sum-when-creating-dashboards/m-p/372009#M24281</link>
    <description>&lt;P&gt;I've been poking at this for a couple of hours, I think I'm missing something obvious but it's a forest for trees thang. &lt;/P&gt;

&lt;P&gt;I have to create 2 dashboards, first is done and tested sat, second uses all of the first except the last line. No, I can't post the exact code. Suffice it to say, I have aggregated 6 fields, a, b, c, x, y, z.&lt;/P&gt;

&lt;P&gt;In the first panel, I had to sum a, b, c and then display them in a timechart span=1mon as a stacked bar chart. Works great.&lt;/P&gt;

&lt;P&gt;In the second panel I have to sum x, y, z, then take that and subtract it from sum of a, b, c, and present sum of x, y, z and diff (a+b+c) - (x+y+z)  in a stacked bar chart, span=1mon.&lt;/P&gt;

&lt;P&gt;Here's the line I have to try to do this, but its not presnting any values (nor errors):&lt;/P&gt;

&lt;P&gt;| timechart span=1mon sum(eval (sum(a) + sum(b) + sum(c)) as value1) sum(eval (sum(a) + sum(b) + sum(c) - sum(x) - sum(y) - sum(z)) as value2)&lt;/P&gt;

&lt;P&gt;Am I allowed to do an eval inside a sum? Is that the issue?&lt;/P&gt;</description>
    <pubDate>Fri, 09 Feb 2018 16:13:06 GMT</pubDate>
    <dc:creator>richkappler</dc:creator>
    <dc:date>2018-02-09T16:13:06Z</dc:date>
    <item>
      <title>Am I allowed to do an eval inside a sum when creating dashboards?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Am-I-allowed-to-do-an-eval-inside-a-sum-when-creating-dashboards/m-p/372009#M24281</link>
      <description>&lt;P&gt;I've been poking at this for a couple of hours, I think I'm missing something obvious but it's a forest for trees thang. &lt;/P&gt;

&lt;P&gt;I have to create 2 dashboards, first is done and tested sat, second uses all of the first except the last line. No, I can't post the exact code. Suffice it to say, I have aggregated 6 fields, a, b, c, x, y, z.&lt;/P&gt;

&lt;P&gt;In the first panel, I had to sum a, b, c and then display them in a timechart span=1mon as a stacked bar chart. Works great.&lt;/P&gt;

&lt;P&gt;In the second panel I have to sum x, y, z, then take that and subtract it from sum of a, b, c, and present sum of x, y, z and diff (a+b+c) - (x+y+z)  in a stacked bar chart, span=1mon.&lt;/P&gt;

&lt;P&gt;Here's the line I have to try to do this, but its not presnting any values (nor errors):&lt;/P&gt;

&lt;P&gt;| timechart span=1mon sum(eval (sum(a) + sum(b) + sum(c)) as value1) sum(eval (sum(a) + sum(b) + sum(c) - sum(x) - sum(y) - sum(z)) as value2)&lt;/P&gt;

&lt;P&gt;Am I allowed to do an eval inside a sum? Is that the issue?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 16:13:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Am-I-allowed-to-do-an-eval-inside-a-sum-when-creating-dashboards/m-p/372009#M24281</guid>
      <dc:creator>richkappler</dc:creator>
      <dc:date>2018-02-09T16:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Am I allowed to do an eval inside a sum when creating dashboards?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Am-I-allowed-to-do-an-eval-inside-a-sum-when-creating-dashboards/m-p/372010#M24282</link>
      <description>&lt;P&gt;I see I added too many parens, it's actually this: &lt;/P&gt;

&lt;P&gt;| timechart span=1mon sum(eval (sum(a) + sum(b) + sum(c)) as value1 sum(eval (sum(a) + sum(b) + sum(c) - sum(x) - sum(y) - sum(z)) as value2&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 16:16:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Am-I-allowed-to-do-an-eval-inside-a-sum-when-creating-dashboards/m-p/372010#M24282</guid>
      <dc:creator>richkappler</dc:creator>
      <dc:date>2018-02-09T16:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Am I allowed to do an eval inside a sum when creating dashboards?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Am-I-allowed-to-do-an-eval-inside-a-sum-when-creating-dashboards/m-p/372011#M24283</link>
      <description>&lt;P&gt;I now also see why sum(eval (a bunch of sums)) won't work, there's nothing for the outside sum to sum. Not sure how to proceed though.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 16:26:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Am-I-allowed-to-do-an-eval-inside-a-sum-when-creating-dashboards/m-p/372011#M24283</guid>
      <dc:creator>richkappler</dc:creator>
      <dc:date>2018-02-09T16:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: Am I allowed to do an eval inside a sum when creating dashboards?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Am-I-allowed-to-do-an-eval-inside-a-sum-when-creating-dashboards/m-p/372012#M24284</link>
      <description>&lt;P&gt;Hi richkappler,&lt;BR /&gt;
are you using Post Process search?&lt;BR /&gt;
if yes, at the end of the base search you have to insert&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| fields list_of_used_fields
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if this isn't your problem, try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| bin_time  span=1mon 
| eval value1=a+b+c, value2=a+b+c-x-y-z
| timechart sum(value1) AS value1 sum(value2) AS value2 BY _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 16:27:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Am-I-allowed-to-do-an-eval-inside-a-sum-when-creating-dashboards/m-p/372012#M24284</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2018-02-09T16:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Am I allowed to do an eval inside a sum when creating dashboards?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Am-I-allowed-to-do-an-eval-inside-a-sum-when-creating-dashboards/m-p/372013#M24285</link>
      <description>&lt;P&gt;Thanks Giuseppe, that didn't quite work. Here's what I've got now:&lt;/P&gt;

&lt;P&gt;| stats sum(x) as X, sum(y) as Y, sum(z) as Z, sum(a) as A, sum(b) as B, sum(c) as C&lt;BR /&gt;
| eval VALUE_1= X + Y + Z&lt;BR /&gt;
| eval VALUE_2=A + B + C - VALUE_1&lt;BR /&gt;
| timechart span=1mon sum(VALUE_1) as VALUE_1 sum(VALUE_2) as VALUE_2&lt;/P&gt;

&lt;P&gt;If I leave off that last line, I get the statistics table with all the correct values. Adding the timechart gives me no result. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:02:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Am-I-allowed-to-do-an-eval-inside-a-sum-when-creating-dashboards/m-p/372013#M24285</guid>
      <dc:creator>richkappler</dc:creator>
      <dc:date>2020-09-29T18:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: Am I allowed to do an eval inside a sum when creating dashboards?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Am-I-allowed-to-do-an-eval-inside-a-sum-when-creating-dashboards/m-p/372014#M24286</link>
      <description>&lt;P&gt;After that first &lt;CODE&gt;stats&lt;/CODE&gt; call, you don't have any _time fields left, because you didn't carry them through the stats. The &lt;CODE&gt;timechart&lt;/CODE&gt; command requires a &lt;CODE&gt;_time&lt;/CODE&gt; field to work.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:59:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Am-I-allowed-to-do-an-eval-inside-a-sum-when-creating-dashboards/m-p/372014#M24286</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2020-09-29T17:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Am I allowed to do an eval inside a sum when creating dashboards?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Am-I-allowed-to-do-an-eval-inside-a-sum-when-creating-dashboards/m-p/372015#M24287</link>
      <description>&lt;P&gt;Bloody brilliant, missed that. elliotproebstel, post that as a comment, not a reply so I can accept it. By changing stats to eventstats it works. Thanks!!!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 17:02:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Am-I-allowed-to-do-an-eval-inside-a-sum-when-creating-dashboards/m-p/372015#M24287</guid>
      <dc:creator>richkappler</dc:creator>
      <dc:date>2018-02-09T17:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Am I allowed to do an eval inside a sum when creating dashboards?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Am-I-allowed-to-do-an-eval-inside-a-sum-when-creating-dashboards/m-p/372016#M24288</link>
      <description>&lt;P&gt;I don't think @elliotproebstel will mind that I took the liberty of converting the comment to an answer for him.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 17:09:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Am-I-allowed-to-do-an-eval-inside-a-sum-when-creating-dashboards/m-p/372016#M24288</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2018-02-09T17:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Am I allowed to do an eval inside a sum when creating dashboards?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Am-I-allowed-to-do-an-eval-inside-a-sum-when-creating-dashboards/m-p/372017#M24289</link>
      <description>&lt;P&gt;Thanks, @micah &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 17:34:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Am-I-allowed-to-do-an-eval-inside-a-sum-when-creating-dashboards/m-p/372017#M24289</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-02-09T17:34:15Z</dc:date>
    </item>
  </channel>
</rss>

