<?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 Using Eval function to calculate percentage in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-Eval-function-to-calculate-percentage/m-p/603092#M209884</link>
    <description>&lt;P&gt;I'm hoping someone can help me out here. I'm looking to create a simple table that displays a column for "count" and another for "Percentage of total". For some reason splunk is not recognizing the total field within the denominator of my eval command. Any suggestions on how to append this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=ABC sourcetype="ABC" "EVNT=SWIendcall" |stats count by OUTCOME | addtotals row=f col=t labelfield=OUTCOME |eval Percentage=ROUND((count/&lt;STRONG&gt;Total&lt;/STRONG&gt;)*100,1)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ldlopez38_0-1656022941493.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20273iB53A17D2E638D08D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ldlopez38_0-1656022941493.png" alt="ldlopez38_0-1656022941493.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jun 2022 22:24:36 GMT</pubDate>
    <dc:creator>ldlopez38</dc:creator>
    <dc:date>2022-06-23T22:24:36Z</dc:date>
    <item>
      <title>Using Eval function to calculate percentage</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Eval-function-to-calculate-percentage/m-p/603092#M209884</link>
      <description>&lt;P&gt;I'm hoping someone can help me out here. I'm looking to create a simple table that displays a column for "count" and another for "Percentage of total". For some reason splunk is not recognizing the total field within the denominator of my eval command. Any suggestions on how to append this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=ABC sourcetype="ABC" "EVNT=SWIendcall" |stats count by OUTCOME | addtotals row=f col=t labelfield=OUTCOME |eval Percentage=ROUND((count/&lt;STRONG&gt;Total&lt;/STRONG&gt;)*100,1)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ldlopez38_0-1656022941493.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20273iB53A17D2E638D08D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ldlopez38_0-1656022941493.png" alt="ldlopez38_0-1656022941493.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 22:24:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Eval-function-to-calculate-percentage/m-p/603092#M209884</guid>
      <dc:creator>ldlopez38</dc:creator>
      <dc:date>2022-06-23T22:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using Eval function to calculate percentage</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Eval-function-to-calculate-percentage/m-p/603106#M209891</link>
      <description>&lt;P&gt;Splunk generally works on a pipeline of events so the total has to be a field in each event. Try something like this.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=ABC sourcetype="ABC" "EVNT=SWIendcall" |stats count by OUTCOME 
| eventstats sum(count) as Total
| eval Percentage=ROUND((count/Total)*100,1)
| addtotals row=f col=t labelfield=OUTCOME &lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 24 Jun 2022 05:45:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Eval-function-to-calculate-percentage/m-p/603106#M209891</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-24T05:45:27Z</dc:date>
    </item>
  </channel>
</rss>

