<?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 Percentages display in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Percentages-display/m-p/454177#M128502</link>
    <description>&lt;P&gt;If I want to display percentages as well as a count for a table and I want the percentages out of the total count of the table, how do I display that?&lt;/P&gt;

&lt;P&gt;|multisearch [search index = blah sourcetype="blah" host=blah &lt;A href="https://community.splunk.com/%22NAME%22=%22blah_*%22"&gt;| tstats count WHERE index = blah sourcetype="blah" host=blah  earliest=@mon &lt;BR /&gt;
| eval earliest=if(count=0,"-1mon@mon","@mon") | table earliest &lt;/A&gt; OR ("NAME"="blah") | eval Coast ="EastCoast"] &lt;/P&gt;

&lt;P&gt;[search index = blah sourcetype="blah " host=blah&lt;BR /&gt;
&lt;A href="https://community.splunk.com/%22NAME%22=%22blah%20_*%22"&gt;| tstats count WHERE index = blah sourcetype="blah " host=blah earliest=@mon &lt;BR /&gt;
| eval earliest=if(count=0,"-1mon@mon","@mon") &lt;BR /&gt;
| table earliest &lt;/A&gt; OR ("NAME"="blah *") | eval Coast ="WestCoast"]| dedup HOST.IP |stats count(blah) as NumberOfIPs by Coast&lt;/P&gt;</description>
    <pubDate>Mon, 23 Jul 2018 15:16:49 GMT</pubDate>
    <dc:creator>shreyad</dc:creator>
    <dc:date>2018-07-23T15:16:49Z</dc:date>
    <item>
      <title>Percentages display</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentages-display/m-p/454177#M128502</link>
      <description>&lt;P&gt;If I want to display percentages as well as a count for a table and I want the percentages out of the total count of the table, how do I display that?&lt;/P&gt;

&lt;P&gt;|multisearch [search index = blah sourcetype="blah" host=blah &lt;A href="https://community.splunk.com/%22NAME%22=%22blah_*%22"&gt;| tstats count WHERE index = blah sourcetype="blah" host=blah  earliest=@mon &lt;BR /&gt;
| eval earliest=if(count=0,"-1mon@mon","@mon") | table earliest &lt;/A&gt; OR ("NAME"="blah") | eval Coast ="EastCoast"] &lt;/P&gt;

&lt;P&gt;[search index = blah sourcetype="blah " host=blah&lt;BR /&gt;
&lt;A href="https://community.splunk.com/%22NAME%22=%22blah%20_*%22"&gt;| tstats count WHERE index = blah sourcetype="blah " host=blah earliest=@mon &lt;BR /&gt;
| eval earliest=if(count=0,"-1mon@mon","@mon") &lt;BR /&gt;
| table earliest &lt;/A&gt; OR ("NAME"="blah *") | eval Coast ="WestCoast"]| dedup HOST.IP |stats count(blah) as NumberOfIPs by Coast&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 15:16:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentages-display/m-p/454177#M128502</guid>
      <dc:creator>shreyad</dc:creator>
      <dc:date>2018-07-23T15:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Percentages display</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentages-display/m-p/454178#M128503</link>
      <description>&lt;P&gt;you could use &lt;CODE&gt;|top&lt;/CODE&gt; otherwise you'll have to do some math.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|stats count(_raw) as total
|stats count(x) by x as foo
|eval perc = ((foo / total)*100) + "%"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.2/SearchReference/Top"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.2/SearchReference/Top&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 17:12:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentages-display/m-p/454178#M128503</guid>
      <dc:creator>CarsonZa</dc:creator>
      <dc:date>2018-07-23T17:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Percentages display</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentages-display/m-p/454179#M128504</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|multisearch [search index = blah sourcetype="blah" host=blah [| tstats count WHERE index = blah sourcetype="blah" host=blah  earliest=@mon 
| eval earliest=if(count=0,"-1mon@mon","@mon") | table earliest ] 
 ("NAME"="blah_*") OR ("NAME"="blah") | eval Coast ="EastCoast"] 
[search index = blah sourcetype="blah " host=blah
[| tstats count WHERE index = blah sourcetype="blah " host=blah earliest=@mon 
| eval earliest=if(count=0,"-1mon@mon","@mon") 
| table earliest ] 
("NAME"="blah _*") OR ("NAME"="blah *") | eval Coast ="WestCoast"]| dedup HOST.IP |stats count(blah) as NumberOfIPs by Coast
| eventstats sum(NumberOfIPs) as Total
| eval Percentage=round(NumberOfIPs*100/Total,2) 
| fields - Total
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Jul 2018 17:36:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentages-display/m-p/454179#M128504</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-07-23T17:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Percentages display</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentages-display/m-p/454180#M128505</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 15:37:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentages-display/m-p/454180#M128505</guid>
      <dc:creator>shreyad</dc:creator>
      <dc:date>2018-07-31T15:37:26Z</dc:date>
    </item>
  </channel>
</rss>

