<?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 only return values from a search where the percentage is greater than 5%? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109614#M28623</link>
    <description>&lt;P&gt;Thank you so much, its working&lt;/P&gt;</description>
    <pubDate>Mon, 06 Apr 2015 10:36:07 GMT</pubDate>
    <dc:creator>Laya123</dc:creator>
    <dc:date>2015-04-06T10:36:07Z</dc:date>
    <item>
      <title>How to only return values from a search where the percentage is greater than 5%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109604#M28613</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;

&lt;P&gt;my search is :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* sourcetype=ABC host=ABC c_met="GET" c_u_s="*mweb.dll*"  [search index=* sourcetype=ABC host=ABC c_met="GET" c_u_s="*mweb.dll*" | where isnull(kid) and isnotnull(project) | stats count(project) as PCount by project | table project]| eval Sam=if(isnull(s), "NONE",s) | eval UT=if(isnull(kid), "No", "Yes") | stats count(project) as ProCount by project Sam UT| table project ProCount Sam UT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the above search is giving output like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;project ProCount    Sam  UT
A            10     S1   No
A           200     S1  Yes
B            25     S2   No
B           100     S2  Yes
C             2     S3   No
C             1   None     No
C           150     S3  Yes
D             3     S3   No
D             2        S4    No
D           125        S3   Yes
E           125        S2     No
E            10        S2   Yes
F             3     S3   No
F             2        S4    No
F           125        S3   Yes
F            10     S4  Yes
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but I dont want all projects. I want to only see projects where the Nos of UT is greater than 5%.&lt;/P&gt;

&lt;P&gt;This means I want my output to only be projects B &amp;amp; E because only these 2 projects have greater than 5% of Nos for that project.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;project ProCount    Sam  UT
B            25     S2   No
B           100     S2  Yes
E           125        S2     No
E            10        S2   Yes
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please help me do this&lt;/P&gt;

&lt;P&gt;Thanks &lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2015 11:21:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109604#M28613</guid>
      <dc:creator>Laya123</dc:creator>
      <dc:date>2015-03-26T11:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to only return values from a search where the percentage is greater than 5%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109605#M28614</link>
      <description>&lt;P&gt;Hi Laya123,&lt;BR /&gt;
I think what you have to do is to filter your search with the where command.&lt;BR /&gt;
I don't understand what you call the Nos of UT. but assuming that you can you "Nos of UT" and your five_percent , try something like this:&lt;/P&gt;

&lt;P&gt;.......|eval "No of UT"=.....|eval five_percent=.......| table project ProCount Sam UT|where "Nos fo UT" &amp;gt; five_percent &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:20:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109605#M28614</guid>
      <dc:creator>stephane_cyrill</dc:creator>
      <dc:date>2020-09-28T19:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to only return values from a search where the percentage is greater than 5%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109606#M28615</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Thanks for your immediate response, Nos of UT means in my example there is one 'UT' column in that  Yes and No values are there.  I want percentage only for 'No' means where ever projects is having more than 5% of No i want to display only those projects with the same number of columns.&lt;/P&gt;

&lt;P&gt;Thank you so  much&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2015 13:14:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109606#M28615</guid>
      <dc:creator>Laya123</dc:creator>
      <dc:date>2015-03-26T13:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to only return values from a search where the percentage is greater than 5%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109607#M28616</link>
      <description>&lt;P&gt;What happens if you add:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| appendpipe [| stats sum(ProCount) as Total by project] | eval Perc=ProCount/project*100 | search Perc&amp;gt;5 UT="No"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Mar 2015 13:46:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109607#M28616</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-03-26T13:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to only return values from a search where the percentage is greater than 5%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109608#M28617</link>
      <description>&lt;P&gt;Thank you for your response where I have to add this query after the subsearch or end of the search, Pl suggest&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2015 13:48:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109608#M28617</guid>
      <dc:creator>Laya123</dc:creator>
      <dc:date>2015-03-26T13:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to only return values from a search where the percentage is greater than 5%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109609#M28618</link>
      <description>&lt;P&gt;I copied your query after subsearch and end of the subsearch but  not getting any results. pl help me&lt;/P&gt;

&lt;P&gt;Thanks &lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2015 15:06:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109609#M28618</guid>
      <dc:creator>Laya123</dc:creator>
      <dc:date>2015-03-26T15:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to only return values from a search where the percentage is greater than 5%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109610#M28619</link>
      <description>&lt;P&gt;It's very difficult to write a search based on the results of an existing search. Would you be able to post some sample data that we can work with?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2015 16:37:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109610#M28619</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-03-26T16:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to only return values from a search where the percentage is greater than 5%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109611#M28620</link>
      <description>&lt;P&gt;hi,  &lt;/P&gt;

&lt;P&gt;sorry for the late response and thank you so much for your help&lt;/P&gt;

&lt;P&gt;here is the raw sample data &lt;/P&gt;

&lt;P&gt;sourcetype  host    c_met   c_u_s   kid      project    s&lt;BR /&gt;
ABC             ABC           GET  mweb.dll 0djtr1  A         S1&lt;BR /&gt;
ABC                 ABC          GET   mweb.dll 0djtr2  A         S1&lt;BR /&gt;
ABC                 ABC          GET   mweb.dll 0djtr3  A          S1&lt;BR /&gt;
ABC                  ABC     GET   mweb.dll 0djtr4  A          S1&lt;BR /&gt;
ABC                  ABC    GET    mweb.dll             A          S1&lt;BR /&gt;
ABC                  ABC    GET    mweb.dll             A          S1&lt;BR /&gt;
ABC                  ABC    GET    mweb.dll 0djtr5  A         S2&lt;BR /&gt;
ABC                 ABC         GET   mweb.dll  0djtr6  A         S2&lt;BR /&gt;
ABC             ABC         GET   mweb.dll  0djtr7  A         S2&lt;BR /&gt;
ABC                 ABC         GET   mweb.dll  0djtr8  A         S2&lt;BR /&gt;
ABC             ABC     GET   mweb.dll  0djtr9  A         S2&lt;BR /&gt;
ABC                 ABC         GET   mweb.dll  0djtr10 A         S2&lt;BR /&gt;
ABC                 ABC         GET   mweb.dll  abcd1    B         S1&lt;BR /&gt;
ABC                 ABC         GET   mweb.dll  abcd2   B         S1&lt;BR /&gt;
ABC                  ABC    GET   mweb.dll  abcd3   B         S1&lt;BR /&gt;
ABC                  ABC    GET mweb.dll    abcd4   B          S1&lt;BR /&gt;
ABC             ABC         GET mweb.dll                B          S1&lt;BR /&gt;
ABC                 ABC         GET mweb.dll                B          S1&lt;BR /&gt;
ABC                  ABC    GET mweb.dll                B          S2&lt;BR /&gt;
ABC                  ABC    GET mweb.dll                B&lt;BR /&gt;&lt;BR /&gt;
ABC                 ABC         GET mweb.dll                B&lt;BR /&gt;&lt;BR /&gt;
ABC                 ABC         GET mweb.dll                B          S2&lt;BR /&gt;
ABC                ABC          GET mweb.dll    abcd9   B           S2&lt;BR /&gt;
ABC                ABC          GET mweb.dll    abcd9   B            S2&lt;BR /&gt;
ABC                 ABC     GET mweb.dll    lkimn1  C           S1&lt;BR /&gt;
ABC                ABC          GET mweb.dll    lkimn2  C            S1&lt;BR /&gt;
ABC                 ABC     GET mweb.dll    lkimn3  C            S1&lt;BR /&gt;
ABC                 ABC        GET  mweb.dll    lkimn4  C             S1&lt;BR /&gt;
ABC                 ABC        GET  mweb.dll                C               S1&lt;BR /&gt;
ABC                 ABC         GET mweb.dll                C            S1&lt;BR /&gt;
ABC                 ABC         GET mweb.dll                C&lt;BR /&gt;&lt;BR /&gt;
ABC                ABC          GET mweb.dll    lkimn6  C            S2&lt;BR /&gt;
ABC                ABC          GET mweb.dll    lkimn7  C            S2&lt;BR /&gt;
ABC                ABC         GET  mweb.dll    lkimn8  C            S2&lt;BR /&gt;
ABC                ABC         GET  mweb.dll    lkimn9  C            S2&lt;BR /&gt;
ABC                ABC          GET mweb.dll    lkimn10 C            S2&lt;/P&gt;

&lt;P&gt;form above data for some projects there is no kid  my query is giving correct results only but i am getting all projects, but i want no kid &amp;gt;5% projects . I want my output from the above data is&lt;/P&gt;

&lt;P&gt;My query:&lt;BR /&gt;
 index=* sourcetype=ABC host=ABC c_met="GET" c_u_s="&lt;EM&gt;mweb.dll&lt;/EM&gt;" [search index=* sourcetype=ABC host=ABC c_met="GET" c_u_s="&lt;EM&gt;mweb.dll&lt;/EM&gt;" | where isnull(kid) and isnotnull(project) | stats count(project) as PCount by project | table project]| eval Sam=if(isnull(s), "NONE",s) | eval UT=if(isnull(kid), "No", "Yes") | stats count(project) as ProCount by project Sam UT| table project ProCount Sam UT&lt;/P&gt;

&lt;P&gt;using the above query i am getting all projects but i want only B. why because total procount = 12 out of this 6 are not having kid means 50% not having kid. like this i want my output where not having kid&amp;gt;5% of projects&lt;/P&gt;

&lt;P&gt;project    ProCount    Sam     UT&lt;BR /&gt;
 B             4                     S1     Yes&lt;BR /&gt;
 B             2                     S1     No&lt;BR /&gt;
 B             2                     S2     No&lt;BR /&gt;
 B             2                     S2     Yes&lt;BR /&gt;
 B             2                 NONE  No&lt;/P&gt;

&lt;P&gt;Thank you so much&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:21:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109611#M28620</guid>
      <dc:creator>Laya123</dc:creator>
      <dc:date>2020-09-28T19:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to only return values from a search where the percentage is greater than 5%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109612#M28621</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;
Thank you for your response&lt;/P&gt;

&lt;P&gt;I sent the sample data can you help me &lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 11:44:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109612#M28621</guid>
      <dc:creator>Laya123</dc:creator>
      <dc:date>2015-04-01T11:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to only return values from a search where the percentage is greater than 5%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109613#M28622</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=* sourcetype=ABC host=ABC c_met="GET" c_u_s="*mweb.dll*"  [search index=* sourcetype=ABC host=ABC c_met="GET" c_u_s="*mweb.dll*" | where isnull(kid) and isnotnull(project) | stats count(project) as PCount by project | table project]| eval Sam=if(isnull(s), "NONE",s) | eval UT=if(isnull(kid), "No", "Yes") | stats count(project) as ProCount by project Sam UT| table project ProCount Sam UT | eval NoCount=if(UT="No",ProCount,0) | eventstats sum(NoCount) as NoCount sum(ProCount) as Total by project | where NoCount&amp;gt;0.05*Total | fields - NoCount Total
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Apr 2015 15:49:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109613#M28622</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-04-02T15:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to only return values from a search where the percentage is greater than 5%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109614#M28623</link>
      <description>&lt;P&gt;Thank you so much, its working&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2015 10:36:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-only-return-values-from-a-search-where-the-percentage-is/m-p/109614#M28623</guid>
      <dc:creator>Laya123</dc:creator>
      <dc:date>2015-04-06T10:36:07Z</dc:date>
    </item>
  </channel>
</rss>

