<?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: Show the a particular percentage using Single Value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Show-the-a-particular-percentage-using-Single-Value/m-p/447099#M126774</link>
    <description>&lt;P&gt;@JRamirezEnosys, just want to add that special characters &lt;CODE&gt;&amp;lt;&lt;/CODE&gt; and &lt;CODE&gt;&amp;gt;&lt;/CODE&gt; got escaped while posting on Splunk Answers. So you should use &lt;CODE&gt;&amp;amp; lt;&lt;/CODE&gt; &lt;CODE&gt;&amp;amp; lt;&lt;/CODE&gt;FIELD &lt;CODE&gt;&amp;amp; gt;&lt;/CODE&gt; &lt;CODE&gt;&amp;amp; gt;&lt;/CODE&gt; instead of  &lt;CODE&gt;&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Refer to documentation for &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Foreach"&gt;foreach&lt;/A&gt; command related details.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jun 2018 12:05:29 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2018-06-07T12:05:29Z</dc:date>
    <item>
      <title>Show the a particular percentage using Single Value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-the-a-particular-percentage-using-Single-Value/m-p/447094#M126769</link>
      <description>&lt;P&gt;Hello Splunkers,&lt;/P&gt;

&lt;P&gt;I've been trying to show in a Single Value Visualization 3 different percentage values.&lt;/P&gt;

&lt;P&gt;My search looks into a single field of Email Actioning called "Act" , they are Accepted (Acc), Rejected (Rej) and Bounced (Bnc)&lt;/P&gt;

&lt;P&gt;Best I was able to do was&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=email_logs Dir=inbound | timechart span=1d count by Act | untable _time Act count | eventstats sum(count) as Total by _time | eval perc=round(count*100/Total,2) | table _time Act perc | xyseries _time Act perc 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Whenever I send it as a Single Value it will show the Highest Value, Accepted on this case, but I don't see a way to show the Rejected or Bounced as a separate Single Value representation.&lt;/P&gt;

&lt;P&gt;Could I get some advice,&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 07:00:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-the-a-particular-percentage-using-Single-Value/m-p/447094#M126769</guid>
      <dc:creator>JRamirezEnosys</dc:creator>
      <dc:date>2018-06-06T07:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: Show the a particular percentage using Single Value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-the-a-particular-percentage-using-Single-Value/m-p/447095#M126770</link>
      <description>&lt;P&gt;I guess you have two options to achieve that:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;If you're on a recent version of Splunk (6.6.x or 7.x), you could use the &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Viz/VisualizationTrellis"&gt;Trellis&lt;/A&gt; layout, to split by Act and show multiple single value visualizations in 1 go.&lt;/LI&gt;
&lt;LI&gt;Create separate dashboard panels for each of the 3 data points.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Wed, 06 Jun 2018 07:56:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-the-a-particular-percentage-using-Single-Value/m-p/447095#M126770</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-06-06T07:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Show the a particular percentage using Single Value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-the-a-particular-percentage-using-Single-Value/m-p/447096#M126771</link>
      <description>&lt;P&gt;Thank you for your response FranKVI,&lt;/P&gt;

&lt;P&gt;I am currently running on 6.5.2 which does not allow me to use Trellis.&lt;/P&gt;

&lt;P&gt;I would go for 3 separate dashboard panels but how do I get the correct percentage to show on every search?&lt;/P&gt;

&lt;P&gt;I need a Search String to find the percentage of Acc, Bnc and Rej separately, is this doable ?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 23:43:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-the-a-particular-percentage-using-Single-Value/m-p/447096#M126771</guid>
      <dc:creator>JRamirezEnosys</dc:creator>
      <dc:date>2018-06-06T23:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: Show the a particular percentage using Single Value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-the-a-particular-percentage-using-Single-Value/m-p/447097#M126772</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33154"&gt;@JRamirezEnosys&lt;/a&gt;, you would need to use Post Processing as your base search is transforming results as Time Series trend of percent of Each category of Act.&lt;/P&gt;

&lt;P&gt;On similar lines to your question, I have used run anywhere example based on Splunk's _internal index which has a field called log_level with three values INFO WARN ERROR. I have changed your query to use &lt;CODE&gt;addtotals&lt;/CODE&gt; with &lt;CODE&gt;row=t&lt;/CODE&gt; to get row-wise total and then used &lt;CODE&gt;foreach&lt;/CODE&gt; command to perform similar eval for INFO ERROR and WARN fields and calculate the total. This search has been used as as base search and fields &lt;CODE&gt;_time&lt;/CODE&gt; and &lt;CODE&gt;ERROR&lt;/CODE&gt; are retained for Error Trend Single Value Panel and similarly for other to series.&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/251888-show-separate-series-in-single-value.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;Please find below the Run anywhere Simple XML Dashboard code for the attached screenshot.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Show Separate Series in Single Value&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;&amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;Base Search All Results (Displaying Only For Demo)&amp;lt;/title&amp;gt;
      &amp;lt;input type="time" token="tokTime" searchWhenChanged="true"&amp;gt;
        &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
        &amp;lt;default&amp;gt;
          &amp;lt;earliest&amp;gt;-7d@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/default&amp;gt;
      &amp;lt;/input&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search id="baseAllLogLevelPercentWithTime"&amp;gt;
          &amp;lt;query&amp;gt;index=_internal sourcetype=splunkd log_level=* 
| timechart span=1d count by log_level 
| addtotals row=t col=f 
| foreach "ERROR" "INFO" "WARN" 
    [| eval "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;"= round(('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'/Total)*100,2) ]
| fields - Total&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$tokTime.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$tokTime.latest$&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;20&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;single&amp;gt;
        &amp;lt;title&amp;gt;INFO % - Single Value Trend&amp;lt;/title&amp;gt;
        &amp;lt;search base="baseAllLogLevelPercentWithTime"&amp;gt;
          &amp;lt;query&amp;gt;| table _time INFO&amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="colorBy"&amp;gt;value&amp;lt;/option&amp;gt;
        &amp;lt;option name="colorMode"&amp;gt;block&amp;lt;/option&amp;gt;
        &amp;lt;option name="rangeColors"&amp;gt;["0xd93f3c","0xf7bc38","0x65a637"]&amp;lt;/option&amp;gt;
        &amp;lt;option name="rangeValues"&amp;gt;[90,95]&amp;lt;/option&amp;gt;
        &amp;lt;option name="unit"&amp;gt;%&amp;lt;/option&amp;gt;
        &amp;lt;option name="useColors"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="useThousandSeparators"&amp;gt;0&amp;lt;/option&amp;gt;
      &amp;lt;/single&amp;gt;
      &amp;lt;single&amp;gt;
        &amp;lt;title&amp;gt;WARN % - Single Value Trend&amp;lt;/title&amp;gt;
        &amp;lt;search base="baseAllLogLevelPercentWithTime"&amp;gt;
          &amp;lt;query&amp;gt;| table _time WARN&amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="colorBy"&amp;gt;value&amp;lt;/option&amp;gt;
        &amp;lt;option name="colorMode"&amp;gt;block&amp;lt;/option&amp;gt;
        &amp;lt;option name="rangeColors"&amp;gt;["0x65a637","0xf7bc38","0xd93f3c"]&amp;lt;/option&amp;gt;
        &amp;lt;option name="rangeValues"&amp;gt;[5,10]&amp;lt;/option&amp;gt;
        &amp;lt;option name="unit"&amp;gt;%&amp;lt;/option&amp;gt;
        &amp;lt;option name="useColors"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="useThousandSeparators"&amp;gt;0&amp;lt;/option&amp;gt;
      &amp;lt;/single&amp;gt;
      &amp;lt;single&amp;gt;
        &amp;lt;title&amp;gt;Error % - Single Value Trend&amp;lt;/title&amp;gt;
        &amp;lt;search base="baseAllLogLevelPercentWithTime"&amp;gt;
          &amp;lt;query&amp;gt;| table _time ERROR&amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="colorBy"&amp;gt;value&amp;lt;/option&amp;gt;
        &amp;lt;option name="colorMode"&amp;gt;block&amp;lt;/option&amp;gt;
        &amp;lt;option name="rangeColors"&amp;gt;["0x65a637","0xf7bc38","0xd93f3c"]&amp;lt;/option&amp;gt;
        &amp;lt;option name="rangeValues"&amp;gt;[5,10]&amp;lt;/option&amp;gt;
        &amp;lt;option name="unit"&amp;gt;%&amp;lt;/option&amp;gt;
        &amp;lt;option name="useColors"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="useThousandSeparators"&amp;gt;0&amp;lt;/option&amp;gt;
      &amp;lt;/single&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:55:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-the-a-particular-percentage-using-Single-Value/m-p/447097#M126772</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-29T19:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: Show the a particular percentage using Single Value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-the-a-particular-percentage-using-Single-Value/m-p/447098#M126773</link>
      <description>&lt;P&gt;I guess the following would work, based of your current query:&lt;/P&gt;

&lt;P&gt;define this as base search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=email_logs Dir=inbound | timechart span=1d count by Act | untable _time Act count | eventstats sum(count) as Total by _time | eval perc=round(count*100/Total,2) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;panel search (example for Acc, use similar for the other 2):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where Act = "Acc" | table _time,perc
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But you might want to take a look at the solution suggested by @niketnilay for a slightly different approach.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 08:05:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-the-a-particular-percentage-using-Single-Value/m-p/447098#M126773</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-06-07T08:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Show the a particular percentage using Single Value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-the-a-particular-percentage-using-Single-Value/m-p/447099#M126774</link>
      <description>&lt;P&gt;@JRamirezEnosys, just want to add that special characters &lt;CODE&gt;&amp;lt;&lt;/CODE&gt; and &lt;CODE&gt;&amp;gt;&lt;/CODE&gt; got escaped while posting on Splunk Answers. So you should use &lt;CODE&gt;&amp;amp; lt;&lt;/CODE&gt; &lt;CODE&gt;&amp;amp; lt;&lt;/CODE&gt;FIELD &lt;CODE&gt;&amp;amp; gt;&lt;/CODE&gt; &lt;CODE&gt;&amp;amp; gt;&lt;/CODE&gt; instead of  &lt;CODE&gt;&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Refer to documentation for &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Foreach"&gt;foreach&lt;/A&gt; command related details.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 12:05:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-the-a-particular-percentage-using-Single-Value/m-p/447099#M126774</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-06-07T12:05:29Z</dc:date>
    </item>
  </channel>
</rss>

