<?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: getting the unique value for each row in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/getting-the-unique-value-for-each-row/m-p/97435#M25147</link>
    <description>&lt;P&gt;In my answer, I am assuming that you have a field named outputField which contains "abhay,murari,chennai" exactly like this - a string where commas separate the values. If this is the case, then the following should work&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere
| eval outputField=split(outputField,",")
| eval uid = splunk_server +  index +  _cd 
| mvexpand outputField
| dedup outputFiled
| mvcombine delim="," uid
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 21 Oct 2012 17:43:46 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2012-10-21T17:43:46Z</dc:date>
    <item>
      <title>getting the unique value for each row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/getting-the-unique-value-for-each-row/m-p/97431#M25143</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a file which contains as follows:&lt;/P&gt;

&lt;H2&gt;Filed_Name&lt;/H2&gt;

&lt;P&gt;abhay,murari,chennai&lt;BR /&gt;
chennai,delhi,chennai&lt;BR /&gt;
murari,murari,abhay&lt;BR /&gt;
delhi&lt;BR /&gt;
chennai,murari&lt;/P&gt;

&lt;P&gt;Now, My output should be : &lt;/P&gt;

&lt;H2&gt;Output_Filed_Name&lt;/H2&gt;

&lt;P&gt;abhay,murari,chennai&lt;BR /&gt;
chennai,delhi&lt;BR /&gt;
murari,abhay&lt;BR /&gt;
delhi&lt;BR /&gt;
chennai,murari&lt;/P&gt;

&lt;P&gt;For each row, I am removing duplicate values, in second row -- out of 2 chennai, I took only one chennai and in 3rd row,----out of 2 murari, I took only one murari.&lt;/P&gt;

&lt;P&gt;Please help !!&lt;BR /&gt;
Thanks in Advance,&lt;/P&gt;

&lt;P&gt;Abhay&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:39:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/getting-the-unique-value-for-each-row/m-p/97431#M25143</guid>
      <dc:creator>abhayneilam</dc:creator>
      <dc:date>2020-09-28T12:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: getting the unique value for each row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/getting-the-unique-value-for-each-row/m-p/97432#M25144</link>
      <description>&lt;P&gt;Do you have these extracted as fields? If you do, this should be a fairly easy problem to solve. If you don't, then that's what you should focus on solving.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Oct 2012 12:38:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/getting-the-unique-value-for-each-row/m-p/97432#M25144</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-10-21T12:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: getting the unique value for each row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/getting-the-unique-value-for-each-row/m-p/97433#M25145</link>
      <description>&lt;P&gt;yaa this field "Output_Field_Name" is an extracted field. which comes from "table" command&lt;/P&gt;

&lt;P&gt;myserch | table fieldone fieldtwo Output_Field_Name&lt;/P&gt;

&lt;P&gt;Please help me to achieve this...&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:39:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/getting-the-unique-value-for-each-row/m-p/97433#M25145</guid>
      <dc:creator>abhayneilam</dc:creator>
      <dc:date>2020-09-28T12:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: getting the unique value for each row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/getting-the-unique-value-for-each-row/m-p/97434#M25146</link>
      <description>&lt;P&gt;I meant that you have the individual values extracted as fields, so "abhay","murari","chennai" would be individual values, not just one field with "abhay,murari,chennai" as one single value.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Oct 2012 14:17:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/getting-the-unique-value-for-each-row/m-p/97434#M25146</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-10-21T14:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: getting the unique value for each row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/getting-the-unique-value-for-each-row/m-p/97435#M25147</link>
      <description>&lt;P&gt;In my answer, I am assuming that you have a field named outputField which contains "abhay,murari,chennai" exactly like this - a string where commas separate the values. If this is the case, then the following should work&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere
| eval outputField=split(outputField,",")
| eval uid = splunk_server +  index +  _cd 
| mvexpand outputField
| dedup outputFiled
| mvcombine delim="," uid
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 21 Oct 2012 17:43:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/getting-the-unique-value-for-each-row/m-p/97435#M25147</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-10-21T17:43:46Z</dc:date>
    </item>
  </channel>
</rss>

