<?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: stats count conditional for multi field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/stats-count-conditional-for-multi-field/m-p/568524#M198131</link>
    <description>&lt;P&gt;now i'm trying something like this;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;search | stats count(B) by A,B |sort -A |where sum(count(B))&amp;gt;3&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Sep 2021 07:28:37 GMT</pubDate>
    <dc:creator>corehan</dc:creator>
    <dc:date>2021-09-27T07:28:37Z</dc:date>
    <item>
      <title>stats count conditional for multi field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-conditional-for-multi-field/m-p/568521#M198130</link>
      <description>&lt;P&gt;Hello dears,&lt;/P&gt;&lt;P&gt;I want to list my search if&amp;nbsp; "B" total count higher than &amp;gt;3 than list by "A"&lt;/P&gt;&lt;P&gt;A and B fields could have variable values, doesn't matter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;search | stats count(B) by A,B |sort -A |where B&amp;gt;3&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 07:18:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-conditional-for-multi-field/m-p/568521#M198130</guid>
      <dc:creator>corehan</dc:creator>
      <dc:date>2021-09-27T07:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: stats count conditional for multi field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-conditional-for-multi-field/m-p/568524#M198131</link>
      <description>&lt;P&gt;now i'm trying something like this;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;search | stats count(B) by A,B |sort -A |where sum(count(B))&amp;gt;3&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 07:28:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-conditional-for-multi-field/m-p/568524#M198131</guid>
      <dc:creator>corehan</dc:creator>
      <dc:date>2021-09-27T07:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: stats count conditional for multi field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-conditional-for-multi-field/m-p/568527#M198133</link>
      <description>&lt;P&gt;Depends on what you mean by "multi-field". Do you want to just count separate occurences of B?&lt;/P&gt;&lt;P&gt;In this case it's just&lt;/P&gt;&lt;PRE&gt;search | stats count(B) by A | where count(B)&amp;gt;3 | sort - A&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;If you want to count distinct values of B, it's not count but dc (distinctcount).&lt;/P&gt;&lt;PRE&gt;search | stats dc(B) by A | where dc(B)&amp;gt;3 | sort - A&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;But if you have a multi-value field B and want to count items within the field,&amp;nbsp; you have to approach it differently&lt;/P&gt;&lt;PRE&gt;search | where mvcount(B)&amp;gt;3 | sort - A&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Sep 2021 08:11:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-conditional-for-multi-field/m-p/568527#M198133</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-09-27T08:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: stats count conditional for multi field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-conditional-for-multi-field/m-p/568531#M198136</link>
      <description>&lt;P&gt;Yes, i want to list ,&amp;nbsp;&lt;SPAN&gt;multi-value field B and want to count items within the field. Should i use stats command before ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I try this but not works for me;&lt;/P&gt;&lt;PRE&gt;search | where mvcount(B)&amp;gt;3 | sort - A&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 08:59:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-conditional-for-multi-field/m-p/568531#M198136</guid>
      <dc:creator>corehan</dc:creator>
      <dc:date>2021-09-27T08:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: stats count conditional for multi field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-conditional-for-multi-field/m-p/568534#M198139</link>
      <description>&lt;P&gt;No. Stats command is for calculating stats pertaining to sets of events. as far as I can understand, you want to have a count of multivalued field entries per each event.&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;PRE&gt;search | eval mvc=mvcount(B)&lt;/PRE&gt;&lt;P&gt;And see if the mvc field is properly calculated.&lt;/P&gt;&lt;P&gt;Also, it usually helps if you provide us with a sample of your data so we know that we all have common understanding of what you want to achieve.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 09:16:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-conditional-for-multi-field/m-p/568534#M198139</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-09-27T09:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: stats count conditional for multi field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-conditional-for-multi-field/m-p/568659#M198175</link>
      <description>&lt;P&gt;Thank you for answers. So, more details for this;&lt;/P&gt;&lt;P&gt;I have lot of network devices and subscribers. So, i want to analyse subscriber compliants. When the total subscriber compliants count reach to 10 number by each device, than list.&lt;/P&gt;&lt;P&gt;my field details;&lt;/P&gt;&lt;P&gt;OLT=Network devices&lt;/P&gt;&lt;P&gt;H = Subscriber IDs&lt;/P&gt;&lt;P&gt;REQUESTNAME = Subscriber compliant types&lt;/P&gt;&lt;P&gt;index=decoder M=NetworkMapDataInit C=GPONChecker OLT="*" | eval Date=date_month." ".date_mday | dedup H,U,S | join H,U,S type=inner [search index=decoder M=WF_CrmRequestAndNetflowTask C=OVERLAY P=checkResult NetflowResultMsg1=NetflowTaskCreated | dedup H,U,S ] &lt;STRONG&gt;| stats count by Date,OLT,H,REQUESTNAME&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="corehan_0-1632814695207.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/16182i027D5E2CE929AED7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="corehan_0-1632814695207.png" alt="corehan_0-1632814695207.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 07:39:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-conditional-for-multi-field/m-p/568659#M198175</guid>
      <dc:creator>corehan</dc:creator>
      <dc:date>2021-09-28T07:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: stats count conditional for multi field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-conditional-for-multi-field/m-p/568667#M198177</link>
      <description>&lt;P&gt;Ahhh, so you want to do stats on simple events. You don't have multivalue fields. Multivalue field holds multiple values within a single event. It's not your case as far as I can see.&lt;/P&gt;&lt;P&gt;Your stats command is a bit too detailed. You just want to group by device, so that's the only field you should leave in the "by" clause. Then you can filter your results.&lt;/P&gt;&lt;PRE&gt;index=decoder M=NetworkMapDataInit C=GPONChecker OLT="*"&lt;BR /&gt;| eval Date=date_month." ".date_mday&lt;BR /&gt;| dedup H,U,S&lt;BR /&gt;| join H,U,S type=inner&lt;BR /&gt;  [search index=decoder M=WF_CrmRequestAndNetflowTask C=OVERLAY P=checkResult NetflowResultMsg1=NetflowTaskCreated&lt;BR /&gt;   | dedup H,U,S ]&lt;BR /&gt;&lt;STRONG&gt;| stats count as complaint_number list(Date) list(H) list(REQUESTNAME) by OLT&lt;BR /&gt;| where complaint_number &amp;gt;= 10&lt;BR /&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;You could also try to lose that join in favour of some stats aggregation but it's another story.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 07:57:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-conditional-for-multi-field/m-p/568667#M198177</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-09-28T07:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: stats count conditional for multi field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-conditional-for-multi-field/m-p/568670#M198178</link>
      <description>&lt;P&gt;you are amazing, works fine. Thank you very much&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I love splunk community..&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 08:10:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-conditional-for-multi-field/m-p/568670#M198178</guid>
      <dc:creator>corehan</dc:creator>
      <dc:date>2021-09-28T08:10:05Z</dc:date>
    </item>
  </channel>
</rss>

