<?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 fetch results by grouping the fields with a condition like count&amp;gt;0? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-results-by-grouping-the-fields-with-a-condition/m-p/273505#M82455</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search |  stats dc(txt_id) as "count of txn_id" by txn_chain_id
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 09 Sep 2016 22:29:01 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-09-09T22:29:01Z</dc:date>
    <item>
      <title>How to fetch results by grouping the fields with a condition like count&gt;0?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-results-by-grouping-the-fields-with-a-condition/m-p/273504#M82454</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;I have fields like &lt;STRONG&gt;txn_id&lt;/STRONG&gt; and &lt;STRONG&gt;txn_chain_id&lt;/STRONG&gt; where &lt;STRONG&gt;txn_chain_id&lt;/STRONG&gt; can have more than 1 &lt;STRONG&gt;txn_id&lt;/STRONG&gt; like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Log 1: .....txn_id=100 txn_chain_id=1000
Log 2: .....txn_id=101 txn_chain_id=1000
Log 3: .....txn_id=102 txn_chain_id=1000
Log 4: .....txn_id=201 txn_chain_id=2000
Log 5: .....txn_id=202 txn_chain_id=2000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And so on.&lt;/P&gt;

&lt;P&gt;I wish to write a search which gives me output as below, dynamically pulling all the &lt;STRONG&gt;txn_chain_ids&lt;/STRONG&gt; having &lt;STRONG&gt;txn_ids&lt;/STRONG&gt; &amp;gt; 1.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;txn_chain_id              count(txn_id)
1000                           3
2000                           2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can someone help me getting the search?&lt;BR /&gt;
Please do the needful.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:56:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-results-by-grouping-the-fields-with-a-condition/m-p/273504#M82454</guid>
      <dc:creator>iamsgsn</dc:creator>
      <dc:date>2020-09-29T10:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch results by grouping the fields with a condition like count&gt;0?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-results-by-grouping-the-fields-with-a-condition/m-p/273505#M82455</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search |  stats dc(txt_id) as "count of txn_id" by txn_chain_id
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Sep 2016 22:29:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-results-by-grouping-the-fields-with-a-condition/m-p/273505#M82455</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-09-09T22:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch results by grouping the fields with a condition like count&gt;0?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-results-by-grouping-the-fields-with-a-condition/m-p/273506#M82456</link>
      <description>&lt;P&gt;Thanks. It worked.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2016 23:30:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-results-by-grouping-the-fields-with-a-condition/m-p/273506#M82456</guid>
      <dc:creator>iamsgsn</dc:creator>
      <dc:date>2016-09-09T23:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch results by grouping the fields with a condition like count&gt;0?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-results-by-grouping-the-fields-with-a-condition/m-p/273507#M82457</link>
      <description>&lt;P&gt;Great.. Please close the question by clicking on the Accept.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2016 23:40:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-results-by-grouping-the-fields-with-a-condition/m-p/273507#M82457</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-09-09T23:40:15Z</dc:date>
    </item>
  </channel>
</rss>

