<?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 How to add percentage on statistic field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-percentage-on-statistic-field/m-p/189973#M54715</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;My search: index=test sourcetype=traffic | stats sum(A) as A sum(B) as B sum(C) as C sum(D) as D | transpose&lt;/P&gt;

&lt;P&gt;A,B,C,D are number, but when I use top command to show percentage, it calculates the number as name, so the result turns out to be 1, which means 25% each.&lt;BR /&gt;
How do I add percentage of each column on statistic fields?&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;以下のサーチから出るそれぞれのfield(A,B,C,D)のパーセンテージを表すにはどうしたらよいでしょうか。&lt;/P&gt;

&lt;P&gt;サーチ文: index=test sourcetype=traffic | stats sum(A) as A sum(B) as B sum(C) as C sum(D) as D | transpose&lt;/P&gt;

&lt;P&gt;※A,B,C,Dはネットワークトラフィックを表す数字です。&lt;/P&gt;

&lt;P&gt;単純にtopコマンドを利用するだけでは、それぞれのフィールドの数字を数字として読み取らず、カウントが１となってしまって、それぞれ25％と表示されてしまいます。。。。&lt;/P&gt;</description>
    <pubDate>Thu, 26 Dec 2013 05:35:32 GMT</pubDate>
    <dc:creator>appleman</dc:creator>
    <dc:date>2013-12-26T05:35:32Z</dc:date>
    <item>
      <title>How to add percentage on statistic field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-percentage-on-statistic-field/m-p/189973#M54715</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;My search: index=test sourcetype=traffic | stats sum(A) as A sum(B) as B sum(C) as C sum(D) as D | transpose&lt;/P&gt;

&lt;P&gt;A,B,C,D are number, but when I use top command to show percentage, it calculates the number as name, so the result turns out to be 1, which means 25% each.&lt;BR /&gt;
How do I add percentage of each column on statistic fields?&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;以下のサーチから出るそれぞれのfield(A,B,C,D)のパーセンテージを表すにはどうしたらよいでしょうか。&lt;/P&gt;

&lt;P&gt;サーチ文: index=test sourcetype=traffic | stats sum(A) as A sum(B) as B sum(C) as C sum(D) as D | transpose&lt;/P&gt;

&lt;P&gt;※A,B,C,Dはネットワークトラフィックを表す数字です。&lt;/P&gt;

&lt;P&gt;単純にtopコマンドを利用するだけでは、それぞれのフィールドの数字を数字として読み取らず、カウントが１となってしまって、それぞれ25％と表示されてしまいます。。。。&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2013 05:35:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-percentage-on-statistic-field/m-p/189973#M54715</guid>
      <dc:creator>appleman</dc:creator>
      <dc:date>2013-12-26T05:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to add percentage on statistic field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-percentage-on-statistic-field/m-p/189974#M54716</link>
      <description>&lt;P&gt;おそらく、、、こんな感じではないでしょうか。&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats sum(A) as A ... | transpose 
| rename column as name, "row 1" as count 
| eventstats sum(count) as total 
| eval percent=100*(count/total) 
| fields - total
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Dec 2013 06:03:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-percentage-on-statistic-field/m-p/189974#M54716</guid>
      <dc:creator>melonman</dc:creator>
      <dc:date>2013-12-26T06:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to add percentage on statistic field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-percentage-on-statistic-field/m-p/189975#M54717</link>
      <description>&lt;P&gt;ありがとうございます！&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2013 06:51:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-percentage-on-statistic-field/m-p/189975#M54717</guid>
      <dc:creator>appleman</dc:creator>
      <dc:date>2013-12-26T06:51:08Z</dc:date>
    </item>
  </channel>
</rss>

