<?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 How to do groupBy based on a field and select the ones when occurrence of a word inside the grouped By values is greater than 2 in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/How-to-do-groupBy-based-on-a-field-and-select-the-ones-when/m-p/210978#M6793</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;
I have a requirement where I have to do a group by initially  and from the groupBy values perform a search operation to filter the final results when the occurrence of a word (count of the word) is greater than 2&lt;/P&gt;

&lt;P&gt;example below:&lt;/P&gt;

&lt;P&gt;I have rows like 1 aaaaaaaaa aaaaa ggggggg aaaaa&lt;BR /&gt;
                             1 ssssssssss sssssssss ssssssss&lt;BR /&gt;
                             2 tttttttttttttttt  yyyyyyy gggggg&lt;BR /&gt;
                             1 eeeeeeeeeeee wwwww wwwww&lt;/P&gt;

&lt;P&gt;from the above example i need to do groupby and from the result, need to do a search operation and pick the count of a word (for example wwwww when its occurrence is greater than 2 (which is true in the last statement) so the final result should be only              1 eeeeeeeeeeee wwwww wwwww&lt;/P&gt;</description>
    <pubDate>Fri, 30 Dec 2016 20:17:14 GMT</pubDate>
    <dc:creator>annibaby13</dc:creator>
    <dc:date>2016-12-30T20:17:14Z</dc:date>
    <item>
      <title>How to do groupBy based on a field and select the ones when occurrence of a word inside the grouped By values is greater than 2</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-do-groupBy-based-on-a-field-and-select-the-ones-when/m-p/210978#M6793</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I have a requirement where I have to do a group by initially  and from the groupBy values perform a search operation to filter the final results when the occurrence of a word (count of the word) is greater than 2&lt;/P&gt;

&lt;P&gt;example below:&lt;/P&gt;

&lt;P&gt;I have rows like 1 aaaaaaaaa aaaaa ggggggg aaaaa&lt;BR /&gt;
                             1 ssssssssss sssssssss ssssssss&lt;BR /&gt;
                             2 tttttttttttttttt  yyyyyyy gggggg&lt;BR /&gt;
                             1 eeeeeeeeeeee wwwww wwwww&lt;/P&gt;

&lt;P&gt;from the above example i need to do groupby and from the result, need to do a search operation and pick the count of a word (for example wwwww when its occurrence is greater than 2 (which is true in the last statement) so the final result should be only              1 eeeeeeeeeeee wwwww wwwww&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2016 20:17:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-do-groupBy-based-on-a-field-and-select-the-ones-when/m-p/210978#M6793</guid>
      <dc:creator>annibaby13</dc:creator>
      <dc:date>2016-12-30T20:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to do groupBy based on a field and select the ones when occurrence of a word inside the grouped By values is greater than 2</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-do-groupBy-based-on-a-field-and-select-the-ones-when/m-p/210979#M6794</link>
      <description>&lt;P&gt;There are several splunk functions which will allow you to do "group by" of same field values like chart, rare, sort, stats, and timechart, eventstats, streamstats, sistats etc. Following is a comparison between SQL and SPL(Splunk Processing Language).&lt;/P&gt;

&lt;P&gt;DB SQL Example&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SELECT mycolumn, avg(mycolumn)
FROM mytable
WHERE mycolumn=value
GROUP BY mycolumn
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;SPL Example in Splunk&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=mytable mycolumn=value
| STATS avg(mycolumn) BY mycolumn
| FIELDS mycolumn, avg(mycolumn)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Refer to the Splunk documentation on transitioning from SQL to Splunk: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/SQLtoSplunk"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/SQLtoSplunk&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You would need to provide more examples of your data so that we can identify data type(based on source of data), field names and suggest query as per your need).&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2017 03:58:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-do-groupBy-based-on-a-field-and-select-the-ones-when/m-p/210979#M6794</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-01-01T03:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to do groupBy based on a field and select the ones when occurrence of a word inside the grouped By values is greater than 2</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-do-groupBy-based-on-a-field-and-select-the-ones-when/m-p/210980#M6795</link>
      <description>&lt;P&gt;Have you looked at this post : &lt;A href="https://answers.splunk.com/answers/253863/how-do-i-search-the-count-of-how-many-times-a-keyw.html"&gt;https://answers.splunk.com/answers/253863/how-do-i-search-the-count-of-how-many-times-a-keyw.html&lt;/A&gt; ?&lt;/P&gt;

&lt;P&gt;BTW, If you want to keep the original events but run stats at the same time, then probably you should try the eventstats function (after using the post above) .&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2017 14:40:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-do-groupBy-based-on-a-field-and-select-the-ones-when/m-p/210980#M6795</guid>
      <dc:creator>maraman_splunk</dc:creator>
      <dc:date>2017-01-01T14:40:29Z</dc:date>
    </item>
  </channel>
</rss>

