<?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 Calculating percentage and placing in a radial gauge in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Calculating-percentage-and-placing-in-a-radial-gauge/m-p/88939#M22766</link>
    <description>&lt;P&gt;I am trying to a radial gauge to report a percentage.  I've built my search and the field that I want to report on has 4 different values.&lt;/P&gt;

&lt;P&gt;I have my basic search and then the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count by myfield | gauge count by myfield=normal*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which gives me a gauge value of 4 but that only reflect the total different values of the field "severity".&lt;/P&gt;

&lt;P&gt;I've tried to place an eval but it doesn't take&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count myfield1 as (search severity=normal) 
| stats count myfield2 as (search severity="*") 
| eval myfield=100*(myfield1/myfield2) 
| gauge myfield 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 12 Oct 2012 21:27:17 GMT</pubDate>
    <dc:creator>ronmurphy</dc:creator>
    <dc:date>2012-10-12T21:27:17Z</dc:date>
    <item>
      <title>Calculating percentage and placing in a radial gauge</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-percentage-and-placing-in-a-radial-gauge/m-p/88939#M22766</link>
      <description>&lt;P&gt;I am trying to a radial gauge to report a percentage.  I've built my search and the field that I want to report on has 4 different values.&lt;/P&gt;

&lt;P&gt;I have my basic search and then the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count by myfield | gauge count by myfield=normal*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which gives me a gauge value of 4 but that only reflect the total different values of the field "severity".&lt;/P&gt;

&lt;P&gt;I've tried to place an eval but it doesn't take&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count myfield1 as (search severity=normal) 
| stats count myfield2 as (search severity="*") 
| eval myfield=100*(myfield1/myfield2) 
| gauge myfield 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Oct 2012 21:27:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-percentage-and-placing-in-a-radial-gauge/m-p/88939#M22766</guid>
      <dc:creator>ronmurphy</dc:creator>
      <dc:date>2012-10-12T21:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating percentage and placing in a radial gauge</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-percentage-and-placing-in-a-radial-gauge/m-p/88940#M22767</link>
      <description>&lt;P&gt;Something like this should work: &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=bar severity=* | eval foo=if(severity=="normal",1,0) | stats count as total, sum(foo) | rename sum(foo) as foo | eval percfoo=100*(foo/total) | gauge percfoo&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps, &lt;/P&gt;

&lt;P&gt;d.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2012 00:15:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-percentage-and-placing-in-a-radial-gauge/m-p/88940#M22767</guid>
      <dc:creator>_d_</dc:creator>
      <dc:date>2012-10-15T00:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating percentage and placing in a radial gauge</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-percentage-and-placing-in-a-radial-gauge/m-p/88941#M22768</link>
      <description>&lt;P&gt;This really helps.  Now what I'm trying to do is timechart these percentages, however the timechart function only seems to work on registered fields.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2012 15:39:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-percentage-and-placing-in-a-radial-gauge/m-p/88941#M22768</guid>
      <dc:creator>ronmurphy</dc:creator>
      <dc:date>2012-10-24T15:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating percentage and placing in a radial gauge</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-percentage-and-placing-in-a-radial-gauge/m-p/88942#M22769</link>
      <description>&lt;P&gt;I used something like this:&lt;/P&gt;

&lt;P&gt;search&lt;BR /&gt;
| dedup ID&lt;BR /&gt;
| eval breached = if(SLA = "Breached", 1, 0)&lt;BR /&gt;
| eval active = if(SLA = "Active", 1, 0)&lt;BR /&gt;
| eval met = if(SLA = "Met", 1, 0)&lt;BR /&gt;
| eval total = 1&lt;BR /&gt;
| stats sum(breached) AS sum_breached, sum(active) AS sum_active, sum(met) AS sum_met, sum(total) AS sum_total&lt;BR /&gt;
| eval perc_breached=((sum_breached/sum_total)*100)&lt;BR /&gt;
| eval perc_active=((sum_active/sum_total)*100)&lt;BR /&gt;
| eval perc_met=((sum_met/sum_total)*100)&lt;BR /&gt;
| gauge perc_met&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:26:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-percentage-and-placing-in-a-radial-gauge/m-p/88942#M22769</guid>
      <dc:creator>jwch</dc:creator>
      <dc:date>2020-09-29T09:26:02Z</dc:date>
    </item>
  </channel>
</rss>

