<?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: Count number of values in multi-valued field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-values-in-multi-valued-field/m-p/611103#M212494</link>
    <description>&lt;P&gt;thanks i will create new thread&lt;/P&gt;</description>
    <pubDate>Mon, 29 Aug 2022 07:33:13 GMT</pubDate>
    <dc:creator>vijay_k</dc:creator>
    <dc:date>2022-08-29T07:33:13Z</dc:date>
    <item>
      <title>How to count number of values in multi-valued field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-values-in-multi-valued-field/m-p/280541#M84670</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;In any event i have two fields, something like:&lt;/P&gt;
&lt;P&gt;User - Bob&lt;BR /&gt;Hobbies - Singing, Dancing, Eating&lt;/P&gt;
&lt;P&gt;The "Hobbies" field is a multivalued field, and i want the output to be something like this:&lt;/P&gt;
&lt;P&gt;User - Bob&lt;BR /&gt;Hobbies_Number - 3&lt;BR /&gt;Hobbies - Singing, Dancing, Eating&lt;/P&gt;
&lt;P&gt;TL;DR - Is there an easy way to count how many values are in a multivalued field and show it?&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 15:02:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-values-in-multi-valued-field/m-p/280541#M84670</guid>
      <dc:creator>LAcioffi</dc:creator>
      <dc:date>2022-08-22T15:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of values in multi-valued field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-values-in-multi-valued-field/m-p/280542#M84671</link>
      <description>&lt;P&gt;use the &lt;CODE&gt;mvcount&lt;/CODE&gt; eval function&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... | eval Hobbies_Number = mvcount(Hobbies)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2017 14:24:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-values-in-multi-valued-field/m-p/280542#M84671</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2017-02-07T14:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of values in multi-valued field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-values-in-multi-valued-field/m-p/610299#M212233</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/88405"&gt;@rjthibod&lt;/a&gt;&amp;nbsp; for mvcount should we pass token value ? should it be with $$&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 07:45:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-values-in-multi-valued-field/m-p/610299#M212233</guid>
      <dc:creator>vijay_k</dc:creator>
      <dc:date>2022-08-22T07:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of values in multi-valued field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-values-in-multi-valued-field/m-p/610321#M212239</link>
      <description>&lt;P&gt;It probably depends on what the token represents.&lt;/P&gt;&lt;P&gt;In the original answer, the example was asking for `mvcount` against a known field name.&lt;/P&gt;&lt;P&gt;So, if the token you are passing is a field name and not a value of a field, then it would work.&lt;/P&gt;&lt;P&gt;You'd have to give more specific data about your requests to get a more confident answer, but even then, I haven't been an active Splunk dev for quite some time. So everything I say might be off.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 11:01:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-values-in-multi-valued-field/m-p/610321#M212239</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2022-08-22T11:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of values in multi-valued field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-values-in-multi-valued-field/m-p/610327#M212241</link>
      <description>&lt;P&gt;&amp;lt;input type="multiselect" token="product_token" searchWhenChanged="true"&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Product types&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;&lt;BR /&gt;&amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;&lt;BR /&gt;&amp;lt;prefix&amp;gt;(&amp;lt;/prefix&amp;gt;&lt;BR /&gt;&amp;lt;suffix&amp;gt;)&amp;lt;/suffix&amp;gt;&lt;BR /&gt;&amp;lt;initialValue&amp;gt;*&amp;lt;/initialValue&amp;gt;&lt;BR /&gt;&amp;lt;valuePrefix&amp;gt;DB_Product="*&amp;lt;/valuePrefix&amp;gt;&lt;BR /&gt;&amp;lt;valueSuffix&amp;gt;*"&amp;lt;/valueSuffix&amp;gt;&lt;BR /&gt;&amp;lt;delimiter&amp;gt; OR &amp;lt;/delimiter&amp;gt;&lt;BR /&gt;&amp;lt;fieldForLabel&amp;gt;DB_Product&amp;lt;/fieldForLabel&amp;gt;&lt;BR /&gt;&amp;lt;fieldForValue&amp;gt;DB_Product&amp;lt;/fieldForValue&amp;gt;&lt;BR /&gt;&amp;lt;search base="base_search_Products"&amp;gt;&lt;BR /&gt;&amp;lt;query&amp;gt;|dedup DB_Product | table DB_Product&amp;lt;/query&amp;gt;&lt;BR /&gt;&amp;lt;/search&amp;gt;&lt;BR /&gt;&amp;lt;/input&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my input multi select , thorugh which user select product Types example - All /A,B,C,D etc&lt;/P&gt;&lt;P&gt;I need to count, How many Product types are selcted by user . This info i need for further processing.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 14:12:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-values-in-multi-valued-field/m-p/610327#M212241</guid>
      <dc:creator>vijay_k</dc:creator>
      <dc:date>2022-08-22T14:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of values in multi-valued field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-values-in-multi-valued-field/m-p/610370#M212251</link>
      <description>&lt;P&gt;99% confident nothing like `mvcount` is going to give you that directly.&lt;/P&gt;&lt;P&gt;Likely have to use custom JS, or write a hidden search that will determine that and runs every time the selection for your input has changed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd suggest posting this as its own question. That will get more attention than putting it in the thread of answered question.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 17:02:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-values-in-multi-valued-field/m-p/610370#M212251</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2022-08-22T17:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of values in multi-valued field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-values-in-multi-valued-field/m-p/611103#M212494</link>
      <description>&lt;P&gt;thanks i will create new thread&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2022 07:33:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-values-in-multi-valued-field/m-p/611103#M212494</guid>
      <dc:creator>vijay_k</dc:creator>
      <dc:date>2022-08-29T07:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of values in multi-valued field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-values-in-multi-valued-field/m-p/623725#M216833</link>
      <description>&lt;P&gt;not working anymore (splunk 9.0.2)&lt;/P&gt;&lt;P&gt;do you have the same issue ?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 13:47:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-values-in-multi-valued-field/m-p/623725#M216833</guid>
      <dc:creator>vince2010091</dc:creator>
      <dc:date>2022-12-08T13:47:13Z</dc:date>
    </item>
  </channel>
</rss>

