<?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 count duplicate instances of multivalue field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/count-duplicate-instances-of-multivalue-field/m-p/451353#M127819</link>
    <description>&lt;P&gt;Hello.&lt;/P&gt;

&lt;P&gt;I have events that have a field "Security_ID" that is a multi value field.  It may contain something like:&lt;/P&gt;

&lt;P&gt;NULL SID&lt;BR /&gt;
user1&lt;/P&gt;

&lt;P&gt;within that one field.  I have found some commands to work with multivalue fields but what I am struggling with it trying to get a count.&lt;/P&gt;

&lt;P&gt;If I have an event with Security_ID containing (user1 and NULL SID) and another event with (user2 and NULL SID) - how can I get a table that contains the stats with a count of how many times each of those combinations shows up?&lt;/P&gt;

&lt;P&gt;ie i want a table looking like this:&lt;/P&gt;

&lt;P&gt;Row 1:  user1 NULLSID       5&lt;BR /&gt;
Row 2: user2 NULLSID        7&lt;/P&gt;</description>
    <pubDate>Wed, 20 Mar 2019 18:52:31 GMT</pubDate>
    <dc:creator>splunkbacon</dc:creator>
    <dc:date>2019-03-20T18:52:31Z</dc:date>
    <item>
      <title>count duplicate instances of multivalue field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/count-duplicate-instances-of-multivalue-field/m-p/451353#M127819</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;

&lt;P&gt;I have events that have a field "Security_ID" that is a multi value field.  It may contain something like:&lt;/P&gt;

&lt;P&gt;NULL SID&lt;BR /&gt;
user1&lt;/P&gt;

&lt;P&gt;within that one field.  I have found some commands to work with multivalue fields but what I am struggling with it trying to get a count.&lt;/P&gt;

&lt;P&gt;If I have an event with Security_ID containing (user1 and NULL SID) and another event with (user2 and NULL SID) - how can I get a table that contains the stats with a count of how many times each of those combinations shows up?&lt;/P&gt;

&lt;P&gt;ie i want a table looking like this:&lt;/P&gt;

&lt;P&gt;Row 1:  user1 NULLSID       5&lt;BR /&gt;
Row 2: user2 NULLSID        7&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 18:52:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/count-duplicate-instances-of-multivalue-field/m-p/451353#M127819</guid>
      <dc:creator>splunkbacon</dc:creator>
      <dc:date>2019-03-20T18:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: count duplicate instances of multivalue field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/count-duplicate-instances-of-multivalue-field/m-p/451354#M127820</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval Security_ID ="NULL SID,user1" 
| append 
    [| makeresults 
    | eval Security_ID ="NULL SID,user2"] 
| append 
    [| makeresults 
    | eval Security_ID ="NULL SID,user2"] 
| append 
    [| makeresults 
    | eval Security_ID ="NULL SID,user3"] 
| makemv delim="," Security_ID 
| eval temp =mvjoin(Security_ID,",") 
| rex field=temp "(?P&amp;lt;sid&amp;gt;.+)\,(?P&amp;lt;user&amp;gt;.+)" 
| stats count by sid, user
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Mar 2019 04:27:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/count-duplicate-instances-of-multivalue-field/m-p/451354#M127820</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-03-21T04:27:00Z</dc:date>
    </item>
  </channel>
</rss>

