<?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: How do I present my search results as a percentage instead of a count? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-present-my-search-results-as-a-percentage-instead-of-a/m-p/252952#M75703</link>
    <description>&lt;P&gt;Try this search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | stats count(U*) as U* | transpose | rename column AS Property "row 1" AS Count | SORT -Count | eval total=if(Property !="U1708_DOCUMENTTITLE",Count,0) | eventstats sum(total) as total | eval Percentage=round(Count*100/total,2) | search Property !="U1708_DOCUMENTTITLE" | table Property Percentage
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 12 Jul 2016 19:12:50 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-07-12T19:12:50Z</dc:date>
    <item>
      <title>How do I present my search results as a percentage instead of a count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-present-my-search-results-as-a-percentage-instead-of-a/m-p/252950#M75701</link>
      <description>&lt;P&gt;Hi everybody!&lt;/P&gt;

&lt;P&gt;My database has to many properties, but important properties to set in my Dashboard starting with "U" (U12A8_TARGETOBJECTSTORENAME, U1708_DOCUMENTTITLE, U1903_ARCHIVALDATE, U2A76_CMSEARCHSCHEMAVERSION, U2D52_ICNAUTORUN, U2E68_ICNCLASSNAME, U3975_TARGETOBJECTCLASSID............)      &lt;/P&gt;

&lt;P&gt;Currently in my Splunk dashboard, I created a "Bar Panel".&lt;/P&gt;

&lt;P&gt;My search is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | stats count(U*) as U* | transpose | rename column AS Property "row 1" AS Count | SORT -Count | search Property !="U1708_DOCUMENTTITLE"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/145259-validrequest.png" alt="alt text" /&gt;&lt;BR /&gt;
My result is perfect, but I prefer to have my result as a percentage, so I want to replace "Count" by "Percentage"...&lt;/P&gt;

&lt;P&gt;So I have to replace count by total like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; percentage = ("U*" * 100) / TOTAL but I don't know how to do that with the "U*"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I define TOTAL like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | stats count(U*) as U*, count(U1708_DOCUMENTTITLE) as TOTAL | transpose | rename column AS Property "row 1" AS Count | SORT -Count | search Property !="U1708_DOCUMENTTITLE"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Do you know how I can do that?&lt;/P&gt;

&lt;P&gt;Thanx a lot for answers!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:11:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-present-my-search-results-as-a-percentage-instead-of-a/m-p/252950#M75701</guid>
      <dc:creator>splunkids75</dc:creator>
      <dc:date>2020-09-29T10:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I present my search results as a percentage instead of a count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-present-my-search-results-as-a-percentage-instead-of-a/m-p/252951#M75702</link>
      <description>&lt;P&gt;Add this to the end&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval perc=tostring(round((Count*100)/Total, 2), "commas")."%"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Jul 2016 19:04:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-present-my-search-results-as-a-percentage-instead-of-a/m-p/252951#M75702</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-12T19:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do I present my search results as a percentage instead of a count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-present-my-search-results-as-a-percentage-instead-of-a/m-p/252952#M75703</link>
      <description>&lt;P&gt;Try this search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | stats count(U*) as U* | transpose | rename column AS Property "row 1" AS Count | SORT -Count | eval total=if(Property !="U1708_DOCUMENTTITLE",Count,0) | eventstats sum(total) as total | eval Percentage=round(Count*100/total,2) | search Property !="U1708_DOCUMENTTITLE" | table Property Percentage
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Jul 2016 19:12:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-present-my-search-results-as-a-percentage-instead-of-a/m-p/252952#M75703</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-07-12T19:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I present my search results as a percentage instead of a count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-present-my-search-results-as-a-percentage-instead-of-a/m-p/252953#M75704</link>
      <description>&lt;P&gt;Hi Sundareshr!&lt;/P&gt;

&lt;P&gt;Thanx for your answer!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2016 08:13:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-present-my-search-results-as-a-percentage-instead-of-a/m-p/252953#M75704</guid>
      <dc:creator>splunkids75</dc:creator>
      <dc:date>2016-07-13T08:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I present my search results as a percentage instead of a count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-present-my-search-results-as-a-percentage-instead-of-a/m-p/252954#M75705</link>
      <description>&lt;P&gt;Hi Somesoni2&lt;/P&gt;

&lt;P&gt;Thanx for your answer! That work fine but I have a little bug with the result, I search to correct it :&lt;BR /&gt;
Splunk say that total is 1096 but it's 1068.&lt;/P&gt;

&lt;P&gt;Thanx again!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2016 08:14:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-present-my-search-results-as-a-percentage-instead-of-a/m-p/252954#M75705</guid>
      <dc:creator>splunkids75</dc:creator>
      <dc:date>2016-07-13T08:14:59Z</dc:date>
    </item>
  </channel>
</rss>

