<?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: eval function inside chart using a variable in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/eval-function-inside-chart-using-a-variable/m-p/84777#M21619</link>
    <description>&lt;P&gt;After going back to it, I cannot reproduce the error... So problem solved I guess.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Nov 2012 14:50:45 GMT</pubDate>
    <dc:creator>guilhem</dc:creator>
    <dc:date>2012-11-22T14:50:45Z</dc:date>
    <item>
      <title>eval function inside chart using a variable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-function-inside-chart-using-a-variable/m-p/84776#M21618</link>
      <description>&lt;P&gt;Hello the splunk community,&lt;/P&gt;

&lt;P&gt;I'm kinda new to splunk, and I'm trying to perform some charting using the eval function like as follow:&lt;/P&gt;

&lt;P&gt;index=index1 action=action1&lt;BR /&gt;
| chart c as count by action, field1 usenull=f useother=f&lt;BR /&gt;
| append [search index=index1 action=action2 AND progress &amp;gt;=0.1 |chart eval(dc(e)/count*100) as percentageOfCount by action, field1 usenull=f useother=f]&lt;/P&gt;

&lt;P&gt;And the result I want:&lt;/P&gt;

&lt;P&gt;action  | field1 1st value                            field1 second value                     field1 third value&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;action1 | count for 1st val                          count for 2nd val                       count for 3rd val&lt;BR /&gt;
action2 | percentageOfCount for 1st val    percentageOfCount for 2nd val   percentageOfCount for 3rd val&lt;/P&gt;

&lt;P&gt;(basically I just want to have the percentage according to the count inside the percentageOfCount value, so I can chart it, and not the number of hit)&lt;/P&gt;

&lt;P&gt;but i get the error:&lt;/P&gt;

&lt;P&gt;Error in 'chart' command: Only the split-by and x-axis fields can be directly referenced in the eval expression.&lt;BR /&gt;
It seems that the chart doesn't replace the count with it's value, or I am missing something?&lt;/P&gt;

&lt;P&gt;If anyone has a workaround, or an explanation of what is happening here it would be very helpfull.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2012 16:24:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-function-inside-chart-using-a-variable/m-p/84776#M21618</guid>
      <dc:creator>guilhem</dc:creator>
      <dc:date>2012-10-09T16:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: eval function inside chart using a variable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-function-inside-chart-using-a-variable/m-p/84777#M21619</link>
      <description>&lt;P&gt;After going back to it, I cannot reproduce the error... So problem solved I guess.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2012 14:50:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-function-inside-chart-using-a-variable/m-p/84777#M21619</guid>
      <dc:creator>guilhem</dc:creator>
      <dc:date>2012-11-22T14:50:45Z</dc:date>
    </item>
  </channel>
</rss>

