<?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 you count the number of occurrences and compare with the total? in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-you-count-the-number-of-occurrences-and-compare-with-the/m-p/385865#M1220</link>
    <description>&lt;P&gt;This should give you the desired results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="Pexip Participant History" local_alias="*video.difi.no*" protocol="MSSIP" | stats list(disconnect_reason) as reasons count(eval(disconnect_reason=="Dialog has failed")) as failed_diag count(*) as total by remote_alias | eval perc_failed=(failed_diag/total*100) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you want to hide one or more of the calculated fields you can always exclude them with &lt;CODE&gt;fields -fieldname&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Feb 2019 14:14:34 GMT</pubDate>
    <dc:creator>DMohn</dc:creator>
    <dc:date>2019-02-12T14:14:34Z</dc:date>
    <item>
      <title>How do you count the number of occurrences and compare with the total?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-you-count-the-number-of-occurrences-and-compare-with-the/m-p/385863#M1218</link>
      <description>&lt;P&gt;I have some call logs that I want to sort. &lt;/P&gt;

&lt;P&gt;I have fields for remote_alias and disconnect_reason. There are many different disconnect reasons, but I want to see how many calls have disconnect_reason="&lt;STRONG&gt;Dialog has failed&lt;/STRONG&gt;" as compared to the total, and then sort it by remote_alias; then, we could see how many times a user has had this reason code compared to the number of times they have called.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="Pexip Participant History" local_alias="*video.difi.no*" protocol="MSSIP" | stats list(disconnect_reason) by remote_alias
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If i run this command, then I'll see results in a list like this:&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/267625-dcreasons.jpg" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;michal here has 9 events, where 1 of them is "dialog has failed". Is there any way to get this all in two columns? One for the total and the other for number of "dialog has failed" occurrences pr remote alias ?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:15:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-do-you-count-the-number-of-occurrences-and-compare-with-the/m-p/385863#M1218</guid>
      <dc:creator>tsushi</dc:creator>
      <dc:date>2020-09-29T23:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do you count the number of occurrences and compare with the total?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-you-count-the-number-of-occurrences-and-compare-with-the/m-p/385864#M1219</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="Pexip Participant History" local_alias="*video.difi.no*" protocol="MSSIP" | stats list(disconnect_reason), count as Total_Count, sum(eval(if(disconnect_reason="dialog has failed",1,0))) as sum_dialog_failed by remote_alias
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Feb 2019 14:10:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-do-you-count-the-number-of-occurrences-and-compare-with-the/m-p/385864#M1219</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-02-12T14:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do you count the number of occurrences and compare with the total?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-you-count-the-number-of-occurrences-and-compare-with-the/m-p/385865#M1220</link>
      <description>&lt;P&gt;This should give you the desired results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="Pexip Participant History" local_alias="*video.difi.no*" protocol="MSSIP" | stats list(disconnect_reason) as reasons count(eval(disconnect_reason=="Dialog has failed")) as failed_diag count(*) as total by remote_alias | eval perc_failed=(failed_diag/total*100) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you want to hide one or more of the calculated fields you can always exclude them with &lt;CODE&gt;fields -fieldname&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 14:14:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-do-you-count-the-number-of-occurrences-and-compare-with-the/m-p/385865#M1220</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-02-12T14:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do you count the number of occurrences and compare with the total?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-you-count-the-number-of-occurrences-and-compare-with-the/m-p/385866#M1221</link>
      <description>&lt;P&gt;Awe heck, that was fast. And it works perfectly as well. Thank you !&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 14:16:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-do-you-count-the-number-of-occurrences-and-compare-with-the/m-p/385866#M1221</guid>
      <dc:creator>tsushi</dc:creator>
      <dc:date>2019-02-12T14:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do you count the number of occurrences and compare with the total?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-you-count-the-number-of-occurrences-and-compare-with-the/m-p/385867#M1222</link>
      <description>&lt;P&gt;Welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 14:19:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-do-you-count-the-number-of-occurrences-and-compare-with-the/m-p/385867#M1222</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-02-12T14:19:56Z</dc:date>
    </item>
  </channel>
</rss>

