<?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: Get top combination from a multi value field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Get-top-combination-from-a-multi-value-field/m-p/418724#M167754</link>
    <description>&lt;P&gt;By same do you mean whole set (e.g. ABCD in your first example data) matching, with order?&lt;/P&gt;</description>
    <pubDate>Wed, 22 Aug 2018 16:22:29 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-08-22T16:22:29Z</dc:date>
    <item>
      <title>Get top combination from a multi value field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-top-combination-from-a-multi-value-field/m-p/418721#M167751</link>
      <description>&lt;P&gt;Hi, I have a multi value field who has data something like below which has been extracted from some web service. &lt;BR /&gt;
I am looking to find the combination which occurs maximum time -&lt;BR /&gt;
Event 1 Combo 1 -&lt;BR /&gt;
A&lt;BR /&gt;
B&lt;BR /&gt;
C&lt;BR /&gt;
D&lt;BR /&gt;
Event 2 Combo 2 -&lt;BR /&gt;
B&lt;BR /&gt;
C&lt;BR /&gt;
D&lt;BR /&gt;
F&lt;BR /&gt;
Event 3 Combo 3 -&lt;BR /&gt;
G&lt;BR /&gt;
B&lt;BR /&gt;
Q&lt;BR /&gt;
R&lt;BR /&gt;
There could be different combinations. I want to compare these combinations and get the one which occurs in maximum events.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 11:24:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-top-combination-from-a-multi-value-field/m-p/418721#M167751</guid>
      <dc:creator>Shashank_87</dc:creator>
      <dc:date>2018-08-22T11:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Get top combination from a multi value field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-top-combination-from-a-multi-value-field/m-p/418722#M167752</link>
      <description>&lt;P&gt;@Shashank_87 so what do you mean by maximum occurrence of a combination? In the above example what would the desired output be? Also are these Single events multi-valued fields? Finally what is the query you have tried so far and what is the output you got?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 12:04:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-top-combination-from-a-multi-value-field/m-p/418722#M167752</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-08-22T12:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Get top combination from a multi value field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-top-combination-from-a-multi-value-field/m-p/418723#M167753</link>
      <description>&lt;P&gt;Ok For example below are the 2 events with multiple values -&lt;BR /&gt;
Combination 1 -&lt;BR /&gt;
Line Rental&lt;BR /&gt;
Player TV (M)&lt;BR /&gt;
Talk Weekends (Corona)&lt;BR /&gt;
Set Top Box 500Gb&lt;BR /&gt;
100 Optical Fibre (Unlimited) (XL100 UL)&lt;BR /&gt;
Value Migration Q1&lt;/P&gt;

&lt;P&gt;Combination 2 -&lt;BR /&gt;
Essential Collection TV L,. TiVo ??5&lt;BR /&gt;
Fun TV (L)&lt;BR /&gt;
Line Rental&lt;BR /&gt;
New Bundle 12 Mont&lt;BR /&gt;
 (Unlimited data) (L70)&lt;BR /&gt;
Talk Evenings and Weekends&lt;BR /&gt;
Set Top Box 500Gb&lt;BR /&gt;
Voicemail Free&lt;/P&gt;

&lt;P&gt;Like this I have extracted and created a table with combinations. Now some of these combinations could be same. So i want to find out those combinations&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 12:42:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-top-combination-from-a-multi-value-field/m-p/418723#M167753</guid>
      <dc:creator>Shashank_87</dc:creator>
      <dc:date>2018-08-22T12:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Get top combination from a multi value field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-top-combination-from-a-multi-value-field/m-p/418724#M167754</link>
      <description>&lt;P&gt;By same do you mean whole set (e.g. ABCD in your first example data) matching, with order?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 16:22:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-top-combination-from-a-multi-value-field/m-p/418724#M167754</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-08-22T16:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get top combination from a multi value field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-top-combination-from-a-multi-value-field/m-p/418725#M167755</link>
      <description>&lt;P&gt;If you have the multivalue fields with values ABCD, BCDF,ABCD,BCDF,JKLM... &lt;BR /&gt;
You want to get ABCD and BCDF as the output? &lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 22:19:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-top-combination-from-a-multi-value-field/m-p/418725#M167755</guid>
      <dc:creator>nadlurinadluri</dc:creator>
      <dc:date>2018-08-24T22:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Get top combination from a multi value field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-top-combination-from-a-multi-value-field/m-p/418726#M167756</link>
      <description>&lt;P&gt;@Shashank_87&lt;/P&gt;

&lt;P&gt;Can you please try the following search? &lt;STRONG&gt;Note:&lt;/STRONG&gt; Here, I have assumed the &lt;CODE&gt;Event&lt;/CODE&gt; field contains the combinations. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH 
| eval Event=mvsort(Event)
| eval Event=mvjoin(Event,",") 
| top Event
| eval Event=split(Event,",")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;My Sample Search:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval Event="A,B,C,D|B,C,D,E|A,B,C,D|B,C,D,E|X,Y,Z|B,A,C,D" 
| eval Event=split(Event,"|") 
| mvexpand Event 
| eval Event=split(Event,",") 
| table Event 
| eval Event=mvsort(Event)
| eval Event=mvjoin(Event,",") 
| top Event
| eval Event=split(Event,",")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here I have managed multivalue with the different order. If you don't want it then remove &lt;CODE&gt;| eval Event=mvsort(Event)&lt;/CODE&gt; from search. &lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 16:43:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-top-combination-from-a-multi-value-field/m-p/418726#M167756</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-08-28T16:43:36Z</dc:date>
    </item>
  </channel>
</rss>

