<?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: Help with multivalue field count in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361541#M106777</link>
    <description>&lt;P&gt;Ty! I did this for counting internal and external recipient_domains, where recipient_domain is an mv field.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;eval count_internal=mvcount(mvfilter(match(recipient_domain, "abc.com")))&lt;/CODE&gt;&lt;BR /&gt;
and&lt;BR /&gt;
  &lt;CODE&gt;eval count_external=mvcount(mvfilter(!match(recipient_domain, "abc.com")))&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 23:14:59 GMT</pubDate>
    <dc:creator>nick405060</dc:creator>
    <dc:date>2020-09-29T23:14:59Z</dc:date>
    <item>
      <title>Help with multivalue field count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361532#M106768</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have  a multivalue field with two values.&lt;/P&gt;

&lt;P&gt;segment_status:&lt;/P&gt;

&lt;P&gt;SUCCEEDED-1234333&lt;/P&gt;

&lt;P&gt;FAILED-34555&lt;/P&gt;

&lt;P&gt;I am trying to get the total of segment status and individual count of  Succeeded and FAILED &lt;/P&gt;

&lt;P&gt;for the total count I have done the below query&lt;/P&gt;

&lt;P&gt;eventtype=abc  ... segment_status=*&lt;BR /&gt;
 | eval abc=mvcount(segment_status) |stats sum(abc) as "Total"--this gives me the correct total of both succeded and failed. but  I am not able to get the individual count of succesded and failed.&lt;/P&gt;

&lt;P&gt;this is the query i tried &lt;BR /&gt;
eventtype=abc  ... segment_status=SUCCEEDED&lt;BR /&gt;
 | eval success=mvcount(segment_status) |stats sum(abc) as "Total" -- this is again giving me the total count but not for success.&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:24:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361532#M106768</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2020-09-29T17:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: Help with multivalue field count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361533#M106769</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval succeeded=mvfilter(match(segment_status, "SUCCEEDED"))
| eval failed=mvfilter(match(segment_status, "FAILED"))
| stats count(succeeded) AS succeeded_count, count(failed) AS failed_count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jan 2018 17:19:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361533#M106769</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2018-01-03T17:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Help with multivalue field count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361534#M106770</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=abc ... segment_status=*
| eval SUCCEEDED=if(isnotnull(mvfind(match(segment_status,"SUCCEEDED"))),1,0)
| eval FAILED=if(isnotnull(mvfind(match(segment_status,"FAILED"))),1,0)
| stats sum(FAILED) as FAILED sum(SUCCEEDED) as SUCCEEDED count as Total
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jan 2018 17:20:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361534#M106770</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-01-03T17:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help with multivalue field count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361535#M106771</link>
      <description>&lt;P&gt;Hi @vrmandadi ,&lt;/P&gt;

&lt;P&gt;Can you please try this one ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=abc ... segment_status=*
| stats sum(eval(like(segment_status,"%FAILED%"))) as FAILED_COUNT sum(eval(like(segment_status,"%SUCCEEDED%"))) as SUCCEEDED_COUNT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My Sample Search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval segment_status="SUCCEEDED-1234333,FAILED-34555" 
| makemv delim="," segment_status 
| append 
    [| makeresults 
    | eval segment_status="SUCCEEDED-1234333,FAILED-34555" 
    | makemv delim="," segment_status] 
| append 
    [| makeresults 
    | eval segment_status="SUCCEEDED-1234333" 
    | makemv delim="," segment_status] 
| append 
    [| makeresults 
    | eval segment_status="FAILED-34555" 
    | makemv delim="," segment_status] 
| append 
    [| makeresults 
    | eval segment_status="FAILED-34555" 
    | makemv delim="," segment_status] 
| stats sum(eval(like(segment_status,"%FAILED%"))) as FAILED_COUNT sum(eval(like(segment_status,"%SUCCEEDED%"))) as SUCCEEDED_COUNT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Kamlesh&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2018 17:43:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361535#M106771</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-01-03T17:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Help with multivalue field count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361536#M106772</link>
      <description>&lt;P&gt;it says Error in 'eval' command: The expression is malformed. Expected ).&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2018 17:56:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361536#M106772</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2018-01-03T17:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help with multivalue field count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361537#M106773</link>
      <description>&lt;P&gt;It shows error&lt;/P&gt;

&lt;P&gt;Error in 'eval' command: The expression is malformed. Expected ).&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2018 17:57:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361537#M106773</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2018-01-03T17:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help with multivalue field count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361538#M106774</link>
      <description>&lt;P&gt;Oops, edited to correct that.  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2018 17:59:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361538#M106774</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2018-01-03T17:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help with multivalue field count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361539#M106775</link>
      <description>&lt;P&gt;Hey kamlesh,&lt;/P&gt;

&lt;P&gt;I tried your search but the results are not correct&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2018 18:01:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361539#M106775</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2018-01-03T18:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help with multivalue field count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361540#M106776</link>
      <description>&lt;P&gt;I just added a bracket and it worked &lt;/P&gt;

&lt;P&gt;| eval succeeded=mvfilter(match(segment_status, "SUCCEEDED")) | eval failed=mvfilter(match(segment_status, "FAILED")) | stats count(succeeded) AS succeeded_count, count(failed) AS failed_count &lt;/P&gt;

&lt;P&gt;Thnks&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:24:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361540#M106776</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2020-09-29T17:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with multivalue field count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361541#M106777</link>
      <description>&lt;P&gt;Ty! I did this for counting internal and external recipient_domains, where recipient_domain is an mv field.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;eval count_internal=mvcount(mvfilter(match(recipient_domain, "abc.com")))&lt;/CODE&gt;&lt;BR /&gt;
and&lt;BR /&gt;
  &lt;CODE&gt;eval count_external=mvcount(mvfilter(!match(recipient_domain, "abc.com")))&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:14:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-multivalue-field-count/m-p/361541#M106777</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2020-09-29T23:14:59Z</dc:date>
    </item>
  </channel>
</rss>

