<?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: Can you help me with a stats count that returns a percentage? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-stats-count-that-returns-a-percentage/m-p/409712#M118195</link>
    <description>&lt;P&gt;it was just an issue in my stats count I close the topic&lt;/P&gt;</description>
    <pubDate>Thu, 28 Feb 2019 08:41:31 GMT</pubDate>
    <dc:creator>jip31</dc:creator>
    <dc:date>2019-02-28T08:41:31Z</dc:date>
    <item>
      <title>Can you help me with a stats count that returns a percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-stats-count-that-returns-a-percentage/m-p/409705#M118188</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I use the search below in order to count event number.&lt;/P&gt;

&lt;P&gt;I want to do the same calculation, but in percent&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype="Start" AND (NOT host=E* AND NOT host=I*)
| eval Degradation_Time=coalesce('Durée de la dégradation','Degradation Time','Tiempo de degradación','Beeinträchtigungszeit') 
| eval File_Name=coalesce(Nom_du_fichier,File_Name,Dateiname,Nombre_de_archivo)  
| stats dc(Degradation_Time) as Total by File_Name 
| sort -Total limit=10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Could you help me please&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 08:01:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-stats-count-that-returns-a-percentage/m-p/409705#M118188</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-02-27T08:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a stats count that returns a percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-stats-count-that-returns-a-percentage/m-p/409706#M118189</link>
      <description>&lt;P&gt;Hi, you can try top command(by default it will give 10 results, so I haven't used limit):&lt;/P&gt;

&lt;P&gt;eventtype="Start" AND (NOT host=E* AND NOT host=I*)&lt;BR /&gt;
2. | eval Degradation_Time=coalesce('Durée de la dégradation','Degradation Time','Tiempo de degradación','Beeinträchtigungszeit') &lt;BR /&gt;
3. | eval File_Name=coalesce(Nom_du_fichier,File_Name,Dateiname,Nombre_de_archivo)&lt;BR /&gt;&lt;BR /&gt;
4. | top Degradation_Time as Total by File_Name&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:26:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-stats-count-that-returns-a-percentage/m-p/409706#M118189</guid>
      <dc:creator>cvssravan</dc:creator>
      <dc:date>2020-09-29T23:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a stats count that returns a percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-stats-count-that-returns-a-percentage/m-p/409707#M118190</link>
      <description>&lt;P&gt;If you want to consider distinct count as well, try this:&lt;/P&gt;

&lt;P&gt;eventtype="Start" AND (NOT host=E* AND NOT host=I*)&lt;BR /&gt;
2. | eval Degradation_Time=coalesce('Durée de la dégradation','Degradation Time','Tiempo de degradación','Beeinträchtigungszeit') &lt;BR /&gt;
3. | eval File_Name=coalesce(Nom_du_fichier,File_Name,Dateiname,Nombre_de_archivo)&lt;BR /&gt;&lt;BR /&gt;
4. | stats dc(Degradation_Time) as Total by File_Name &lt;BR /&gt;
5. | top Total by File_Name&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:26:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-stats-count-that-returns-a-percentage/m-p/409707#M118190</guid>
      <dc:creator>cvssravan</dc:creator>
      <dc:date>2020-09-29T23:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a stats count that returns a percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-stats-count-that-returns-a-percentage/m-p/409708#M118191</link>
      <description>&lt;P&gt;it s not want i want&lt;BR /&gt;
In my query I count the number of degradation time by file name&lt;BR /&gt;
I want the same thing in percent.....&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 12:52:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-stats-count-that-returns-a-percentage/m-p/409708#M118191</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-02-27T12:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a stats count that returns a percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-stats-count-that-returns-a-percentage/m-p/409709#M118192</link>
      <description>&lt;P&gt;What do you mean by "the same calculation in percent" ? &lt;BR /&gt;
What is your total ? The count of distinct Degradation_Time from all files ? The count of Degradation_Time values from the total number of Degradation_Time ?&lt;/P&gt;

&lt;P&gt;Regards , &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:30:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-stats-count-that-returns-a-percentage/m-p/409709#M118192</guid>
      <dc:creator>astatrial</dc:creator>
      <dc:date>2020-09-29T23:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a stats count that returns a percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-stats-count-that-returns-a-percentage/m-p/409710#M118193</link>
      <description>&lt;P&gt;My result is  the  total of degradation time by File_Name. The total is a integer number&lt;BR /&gt;
Now I want the same in percent&lt;BR /&gt;
I have done this but I have not the exactly the same result&lt;BR /&gt;
The first field name in the integer panel is in second position in the percent panel :&lt;/P&gt;

&lt;P&gt;eventtype="Start" AND (NOT host=E* AND NOT host=I*)&lt;BR /&gt;
| eval File_Name=coalesce(Nom_du_fichier,File_Name,Dateiname,Nombre_de_archivo) &lt;BR /&gt;
| stats count by File_Name&lt;BR /&gt;
| eventstats sum(count) as Total &lt;BR /&gt;
| eval Percent=round((count/Total)*100,1). " %" &lt;BR /&gt;
| table File_Name Percent &lt;BR /&gt;
| sort -Percent limit=10&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:27:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-stats-count-that-returns-a-percentage/m-p/409710#M118193</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-09-29T23:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a stats count that returns a percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-stats-count-that-returns-a-percentage/m-p/409711#M118194</link>
      <description>&lt;P&gt;Assuming that you are looking for sum(Degradation_Time) by file and then percentage, not count. See my answer below:&lt;/P&gt;

&lt;P&gt;eventtype="Start" AND (NOT host=E* AND NOT host=I*)&lt;BR /&gt;
 | eval Degradation_Time=coalesce('Durée de la dégradation','Degradation Time','Tiempo de degradación','Beeinträchtigungszeit')&lt;BR /&gt;
 | eval File_Name=coalesce(Nom_du_fichier,File_Name,Dateiname,Nombre_de_archivo)&lt;BR /&gt;
 | stats sum(Degradation_Time) as Degradation_Time_By_File by File_Name &lt;BR /&gt;
&lt;STRONG&gt;| appendcols&lt;/STRONG&gt; &lt;BR /&gt;
[search eventtype="Start" AND (NOT host=E* AND NOT host=I*)&lt;BR /&gt;
 | eval Degradation_Time=coalesce('Durée de la dégradation','Degradation Time','Tiempo de degradación','Beeinträchtigungszeit')&lt;BR /&gt;
| stats sum(Degradation_Time) as Total_Degradation_Time] &lt;BR /&gt;
| filldown Total_Degradation_Time &lt;BR /&gt;
| eval Percent_Degradation_Time_By_File =(Degradation_Time_By_File*100)/Total_Degradation_Time &lt;/P&gt;

&lt;P&gt;Hope it works&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:27:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-stats-count-that-returns-a-percentage/m-p/409711#M118194</guid>
      <dc:creator>cvssravan</dc:creator>
      <dc:date>2020-09-29T23:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a stats count that returns a percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-stats-count-that-returns-a-percentage/m-p/409712#M118195</link>
      <description>&lt;P&gt;it was just an issue in my stats count I close the topic&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 08:41:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-stats-count-that-returns-a-percentage/m-p/409712#M118195</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-02-28T08:41:31Z</dc:date>
    </item>
  </channel>
</rss>

