<?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: Ignore a value in a multivalue if found in another field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Ignore-a-value-in-a-multivalue-if-found-in-another-field/m-p/376521#M110540</link>
    <description>&lt;P&gt;Thanks for the reply. 2nd approach was getting the results but realized different use cases in the data. As a result, most of the data is ignored.&lt;BR /&gt;
Updated the question with updated pic to represent those use cases.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jun 2018 17:58:49 GMT</pubDate>
    <dc:creator>aamer4zangi</dc:creator>
    <dc:date>2018-06-07T17:58:49Z</dc:date>
    <item>
      <title>Ignore a value in a multivalue if found in another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ignore-a-value-in-a-multivalue-if-found-in-another-field/m-p/376517#M110536</link>
      <description>&lt;P&gt;Good day,&lt;BR /&gt;
Suppose I want to compare the data in Column A and Column B. Column B can be a multivalue field or not. &lt;BR /&gt;
If any value of Column B exists in Column A, it should be ignored. Thus, Column C should have unique values.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5180i4D7912FCD73A9B91/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Tried few techniques but not helpful so far. Any suggestions would be helpful.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 15:26:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ignore-a-value-in-a-multivalue-if-found-in-another-field/m-p/376517#M110536</guid>
      <dc:creator>aamer4zangi</dc:creator>
      <dc:date>2018-06-07T15:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore a value in a multivalue if found in another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ignore-a-value-in-a-multivalue-if-found-in-another-field/m-p/376518#M110537</link>
      <description>&lt;P&gt;Can you please provide a sample event?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 16:52:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ignore-a-value-in-a-multivalue-if-found-in-another-field/m-p/376518#M110537</guid>
      <dc:creator>rlalwani_splunk</dc:creator>
      <dc:date>2018-06-07T16:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore a value in a multivalue if found in another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ignore-a-value-in-a-multivalue-if-found-in-another-field/m-p/376519#M110538</link>
      <description>&lt;P&gt;@aamer4zangi if columnB is your multivalued field, try one of the following options:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;yourCurrentSearch&amp;gt;
| stats values(columnA) as columnA by columnB
| where columnA!=columnB
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;yourCurrentSearch&amp;gt;
| mvexpand columnB
| where columnA!=columnB
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Jun 2018 17:06:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ignore-a-value-in-a-multivalue-if-found-in-another-field/m-p/376519#M110538</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-06-07T17:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore a value in a multivalue if found in another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ignore-a-value-in-a-multivalue-if-found-in-another-field/m-p/376520#M110539</link>
      <description>&lt;P&gt;I included a sample event as a image. &lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 17:08:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ignore-a-value-in-a-multivalue-if-found-in-another-field/m-p/376520#M110539</guid>
      <dc:creator>aamer4zangi</dc:creator>
      <dc:date>2018-06-07T17:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore a value in a multivalue if found in another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ignore-a-value-in-a-multivalue-if-found-in-another-field/m-p/376521#M110540</link>
      <description>&lt;P&gt;Thanks for the reply. 2nd approach was getting the results but realized different use cases in the data. As a result, most of the data is ignored.&lt;BR /&gt;
Updated the question with updated pic to represent those use cases.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 17:58:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ignore-a-value-in-a-multivalue-if-found-in-another-field/m-p/376521#M110540</guid>
      <dc:creator>aamer4zangi</dc:creator>
      <dc:date>2018-06-07T17:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore a value in a multivalue if found in another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ignore-a-value-in-a-multivalue-if-found-in-another-field/m-p/376522#M110541</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Can you please try following search?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH
| eval row=1 
| accum row 
| fillnull ColumnB value=" "
| stats count by row ColumnA ColumnB 
| eval ColumnC=if(ColumnA!=ColumnB,ColumnB," ") 
| stats values(ColumnB) as ColumnB values(ColumnC) as ColumnC by row,ColumnA | table ColumnA ColumnB ColumnC
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can also try my following sample search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval ColumnA="foo",ColumnB="foo" 
| append 
    [| makeresults 
    | eval ColumnA="foo",ColumnB="foo,fee",ColumnB=split(ColumnB,",")] 
| append 
    [| makeresults 
    | eval ColumnA="foo",ColumnB="",ColumnB=split(ColumnB,",")] 
| append 
    [| makeresults 
    | eval ColumnA="foo",ColumnB="fee",ColumnB=split(ColumnB,",")] 
| append 
    [| makeresults 
    | eval ColumnA="foo",ColumnB="foo,fee,fff",ColumnB=split(ColumnB,",")] 
| eval row=1 
| accum row 
| fillnull ColumnB value=" "
| stats count by row ColumnA ColumnB 
| eval ColumnC=if(ColumnA!=ColumnB,ColumnB," ") 
| stats values(ColumnB) as ColumnB values(ColumnC) as ColumnC by row,ColumnA | table ColumnA ColumnB ColumnC
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 06:33:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ignore-a-value-in-a-multivalue-if-found-in-another-field/m-p/376522#M110541</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-06-08T06:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore a value in a multivalue if found in another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ignore-a-value-in-a-multivalue-if-found-in-another-field/m-p/376523#M110542</link>
      <description>&lt;P&gt;Thanks for the reply.&lt;/P&gt;

&lt;P&gt;This approach might work when I have a raw event with 3 columns. However, ColumnB is an extracted field and there are other columns as well. This approach changes the search results entirely. &lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 16:43:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ignore-a-value-in-a-multivalue-if-found-in-another-field/m-p/376523#M110542</guid>
      <dc:creator>aamer4zangi</dc:creator>
      <dc:date>2018-06-08T16:43:23Z</dc:date>
    </item>
  </channel>
</rss>

