<?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 to calculate Percentage of particular events out of total events. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457393#M171167</link>
    <description>&lt;P&gt;My karma wont allow me to attach the file.&lt;/P&gt;

&lt;P&gt;This is the next best i could do with raw data.&lt;/P&gt;

&lt;P&gt;40.22%  6544 timestamp ERROR Application error.&lt;BR /&gt;
21.84%  7072 timestamp ERROR [Brandify] GetNearestRestaurants: The operation has timed out&lt;BR /&gt;
7.07%   3380 timestamp ERROR Cannot create tracker.&lt;BR /&gt;
6.79%   Message: Error while rendering view: 'xxx.cshtml' (model: 'Sitecore.Mvc.Presentation.RenderingModel, Sitecore.Mvc').&lt;BR /&gt;
2.85%   4308 timestamp ERROR CreateAccount failed. Time elapsed: 00:00:00.042, ErrorCode: 110, ErrorMessage: Duplicate email address&lt;BR /&gt;
1.73%   3896 timestamp ERROR Cannot finish Analytics page tracking&lt;BR /&gt;
1.34%   3752 timestamp ERROR MediaRequestProtection: An invalid/missing hash value was encountered. The expected hash value: 8A206C19591658B84F4EDE5F513B9A007EF9056A. Media URL: /-/media/header/XXXXXXXXXXX.ashx?h=339&amp;amp;w=1472&amp;amp;la=en&amp;amp;hash=%2527%2520%25278%2527%2520%2527A206C19591658B84F4EDE5F513B9A007EF9056A%2527%2520%2527%2527%2520%2527, Referring URL: &lt;BR /&gt;
0.57% 1404 timestamp ERROR System.OperationCanceledException: The operation was canceled.&lt;BR /&gt;
0.36% Message: Error converting value {null} to type 'System.Single'. Path '[0].latitude', line 1, position 34.&lt;BR /&gt;
0.22% Message: The remote server returned an error: (504) Gateway Timeout.&lt;/P&gt;</description>
    <pubDate>Fri, 17 May 2019 14:23:12 GMT</pubDate>
    <dc:creator>mrigank517</dc:creator>
    <dc:date>2019-05-17T14:23:12Z</dc:date>
    <item>
      <title>How to calculate Percentage of particular events out of total events.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457383#M171157</link>
      <description>&lt;P&gt;I want to find the percent of events with the key word error out of all the events recorded during a time window&lt;BR /&gt;
I have the following query in place but the result generated is 0.0000%&lt;/P&gt;

&lt;P&gt;index=XXX "*" | stats count AS "Total", count(eval(eventMessage=="error")) AS Failure|eval Failurerate=(Failure/Total)*100|table Failurerate&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:32:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457383#M171157</guid>
      <dc:creator>mrigank517</dc:creator>
      <dc:date>2020-09-30T00:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Percentage of particular events out of total events.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457384#M171158</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Please try below query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=XXX "*" | stats count AS "Total", sum(eval(if(eventMessage="error",1,0))) AS Failure|eval Failurerate=(Failure/Total)*100|table Failurerate
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 May 2019 12:18:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457384#M171158</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-05-17T12:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Percentage of particular events out of total events.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457385#M171159</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=XXX  | stats count AS "Total", sum(eval(if(eventMessage=="error", 1, 0))) AS Failure|eval Failurerate=(Failure/Total)*100|table Failurerate
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 May 2019 12:25:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457385#M171159</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2019-05-17T12:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Percentage of particular events out of total events.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457386#M171160</link>
      <description>&lt;P&gt;The query runs fine but the result generated is 0.&lt;BR /&gt;
Ideally it should be above 0&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 12:26:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457386#M171160</guid>
      <dc:creator>mrigank517</dc:creator>
      <dc:date>2019-05-17T12:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Percentage of particular events out of total events.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457387#M171161</link>
      <description>&lt;P&gt;It looks like you don't have field extracted or space or any other character is present in &lt;CODE&gt;eventMessage&lt;/CODE&gt; field&lt;/P&gt;

&lt;P&gt;Can you please run below query and please let us know are you getting any output ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="xxx" eventMessage="error"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 May 2019 12:28:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457387#M171161</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-05-17T12:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Percentage of particular events out of total events.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457388#M171162</link>
      <description>&lt;P&gt;Yeah you sensed it right this returns 0 result. But when searched with the following query the results are populated.&lt;/P&gt;

&lt;P&gt;index="xxx" error&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 12:32:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457388#M171162</guid>
      <dc:creator>mrigank517</dc:creator>
      <dc:date>2019-05-17T12:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Percentage of particular events out of total events.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457389#M171163</link>
      <description>&lt;P&gt;Yes because you are searching &lt;CODE&gt;error&lt;/CODE&gt; word in &lt;STRONG&gt;raw data&lt;/STRONG&gt;, however query which I have provided specifically search &lt;CODE&gt;error&lt;/CODE&gt; word in eventMessage field, so you need to fix your field extraction first then query which I have provided will work.&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 12:34:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457389#M171163</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-05-17T12:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Percentage of particular events out of total events.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457390#M171164</link>
      <description>&lt;P&gt;No luck, as discussed below eventMessage=="error" is not returning any results.&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 12:35:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457390#M171164</guid>
      <dc:creator>mrigank517</dc:creator>
      <dc:date>2019-05-17T12:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Percentage of particular events out of total events.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457391#M171165</link>
      <description>&lt;P&gt;Any hints on how to get the field extracted or to run this through raw data?&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 12:38:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457391#M171165</guid>
      <dc:creator>mrigank517</dc:creator>
      <dc:date>2019-05-17T12:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Percentage of particular events out of total events.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457392#M171166</link>
      <description>&lt;P&gt;If you can provide some sample raw data (please mask sensitive data) then we can write regular expression to extract data in field and then use that field in stats.&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 12:40:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457392#M171166</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-05-17T12:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Percentage of particular events out of total events.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457393#M171167</link>
      <description>&lt;P&gt;My karma wont allow me to attach the file.&lt;/P&gt;

&lt;P&gt;This is the next best i could do with raw data.&lt;/P&gt;

&lt;P&gt;40.22%  6544 timestamp ERROR Application error.&lt;BR /&gt;
21.84%  7072 timestamp ERROR [Brandify] GetNearestRestaurants: The operation has timed out&lt;BR /&gt;
7.07%   3380 timestamp ERROR Cannot create tracker.&lt;BR /&gt;
6.79%   Message: Error while rendering view: 'xxx.cshtml' (model: 'Sitecore.Mvc.Presentation.RenderingModel, Sitecore.Mvc').&lt;BR /&gt;
2.85%   4308 timestamp ERROR CreateAccount failed. Time elapsed: 00:00:00.042, ErrorCode: 110, ErrorMessage: Duplicate email address&lt;BR /&gt;
1.73%   3896 timestamp ERROR Cannot finish Analytics page tracking&lt;BR /&gt;
1.34%   3752 timestamp ERROR MediaRequestProtection: An invalid/missing hash value was encountered. The expected hash value: 8A206C19591658B84F4EDE5F513B9A007EF9056A. Media URL: /-/media/header/XXXXXXXXXXX.ashx?h=339&amp;amp;w=1472&amp;amp;la=en&amp;amp;hash=%2527%2520%25278%2527%2520%2527A206C19591658B84F4EDE5F513B9A007EF9056A%2527%2520%2527%2527%2520%2527, Referring URL: &lt;BR /&gt;
0.57% 1404 timestamp ERROR System.OperationCanceledException: The operation was canceled.&lt;BR /&gt;
0.36% Message: Error converting value {null} to type 'System.Single'. Path '[0].latitude', line 1, position 34.&lt;BR /&gt;
0.22% Message: The remote server returned an error: (504) Gateway Timeout.&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 14:23:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457393#M171167</guid>
      <dc:creator>mrigank517</dc:creator>
      <dc:date>2019-05-17T14:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Percentage of particular events out of total events.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457394#M171168</link>
      <description>&lt;P&gt;Give these a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=XXX "*" | stats count AS "Total", count(eval(searchmatch("error"),1,0)) AS Failure|eval Failurerate=(Failure/Total)*100|table Failurerate
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=XXX "*" | stats count AS "Total", count(eval(match(eventMessage,"error"),1,0)) AS Failure|eval Failurerate=(Failure/Total)*100|table Failurerate
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 May 2019 15:57:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Percentage-of-particular-events-out-of-total/m-p/457394#M171168</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-05-17T15:57:31Z</dc:date>
    </item>
  </channel>
</rss>

