<?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: Calculate the percentage of logs with a certain criteria among all requests in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Calculate-the-percentage-of-logs-with-a-certain-criteria-among/m-p/11105#M675</link>
    <description>&lt;P&gt;Thanks much. Could you explain how this actually works? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Apr 2010 00:33:05 GMT</pubDate>
    <dc:creator>sranga</dc:creator>
    <dc:date>2010-04-16T00:33:05Z</dc:date>
    <item>
      <title>Calculate the percentage of logs with a certain criteria among all requests</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-the-percentage-of-logs-with-a-certain-criteria-among/m-p/11099#M669</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Say I have the following log statements (generated throughout the day):  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;id=111,type=2,field1=y  
id=141,type=23,field1=y  
id=131,type=21,field1=n  
id=121,type=27,field1=n  
...  
...   
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How do I calculate the following?&lt;BR /&gt;
Number of events with field1='y' / Number of total events for that day&lt;/P&gt;

&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2010 04:18:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-the-percentage-of-logs-with-a-certain-criteria-among/m-p/11099#M669</guid>
      <dc:creator>sranga</dc:creator>
      <dc:date>2010-04-08T04:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the percentage of logs with a certain criteria among all requests</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-the-percentage-of-logs-with-a-certain-criteria-among/m-p/11100#M670</link>
      <description>&lt;P&gt;&lt;CODE&gt;sourcetype=mylogs | stats count(eval(field1=="y")) as ycount, count as totalcount | eval pct=ycount/totalcount&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2010 04:45:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-the-percentage-of-logs-with-a-certain-criteria-among/m-p/11100#M670</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-04-08T04:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the percentage of logs with a certain criteria among all requests</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-the-percentage-of-logs-with-a-certain-criteria-among/m-p/11101#M671</link>
      <description>&lt;P&gt;If you don't care about events where field1 doesn't exist at all, you could do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | top field1 | search field1=y
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since the top command calculates percentage automatically.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2010 06:40:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-the-percentage-of-logs-with-a-certain-criteria-among/m-p/11101#M671</guid>
      <dc:creator>Dan</dc:creator>
      <dc:date>2010-04-08T06:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the percentage of logs with a certain criteria among all requests</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-the-percentage-of-logs-with-a-certain-criteria-among/m-p/11102#M672</link>
      <description>&lt;P&gt;Thanks for the response. Certain events may not have the field and we still want to include them in the count.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2010 00:22:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-the-percentage-of-logs-with-a-certain-criteria-among/m-p/11102#M672</guid>
      <dc:creator>sranga</dc:creator>
      <dc:date>2010-04-09T00:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the percentage of logs with a certain criteria among all requests</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-the-percentage-of-logs-with-a-certain-criteria-among/m-p/11103#M673</link>
      <description>&lt;P&gt;Thanks. This solution works in calculating the percentage. Is there a way to chart this data over time?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2010 00:44:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-the-percentage-of-logs-with-a-certain-criteria-among/m-p/11103#M673</guid>
      <dc:creator>sranga</dc:creator>
      <dc:date>2010-04-09T00:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the percentage of logs with a certain criteria among all requests</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-the-percentage-of-logs-with-a-certain-criteria-among/m-p/11104#M674</link>
      <description>&lt;P&gt;&lt;CODE&gt;sourcetype=mylogs | timechart count(eval(field1=="y")) as ycount, count as totalcount | eval pct=ycount/totalcount&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2010 04:39:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-the-percentage-of-logs-with-a-certain-criteria-among/m-p/11104#M674</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-04-09T04:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the percentage of logs with a certain criteria among all requests</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-the-percentage-of-logs-with-a-certain-criteria-among/m-p/11105#M675</link>
      <description>&lt;P&gt;Thanks much. Could you explain how this actually works? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2010 00:33:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-the-percentage-of-logs-with-a-certain-criteria-among/m-p/11105#M675</guid>
      <dc:creator>sranga</dc:creator>
      <dc:date>2010-04-16T00:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the percentage of logs with a certain criteria among all requests</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-the-percentage-of-logs-with-a-certain-criteria-among/m-p/11106#M676</link>
      <description>&lt;P&gt;Its asking stats to count the number of rows in which the eval expression is true, and return that number into a field called ycount.  Then asking it to calculate the total number of rows and return that as a field called 'totalcount'.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2010 08:59:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-the-percentage-of-logs-with-a-certain-criteria-among/m-p/11106#M676</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2010-04-23T08:59:27Z</dc:date>
    </item>
  </channel>
</rss>

