<?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: Compare 2 Multivalue Fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Compare-2-Multivalue-Fields/m-p/559854#M159083</link>
    <description>&lt;P&gt;Thank you for your reply.&amp;nbsp; Adding that line made the search produce 0 results.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Jul 2021 17:44:59 GMT</pubDate>
    <dc:creator>pkohn117</dc:creator>
    <dc:date>2021-07-16T17:44:59Z</dc:date>
    <item>
      <title>Compare 2 Multivalue Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-2-Multivalue-Fields/m-p/559805#M159059</link>
      <description>&lt;P&gt;I am looking to run a search and filter out whitelisted exceptions in a lookup file.&amp;nbsp; 2 of the fields could contain multiple values though.&lt;/P&gt;&lt;P&gt;Here's the search I'm using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=microsoft365 sourcetype IN (azure:aad:signin, o365:management:activity) (action=success OR status=success) NOT Operation=UserLoginFailed 
| eval user_id=lower(user_id)
| dedup src user_id date_month
| iplocation src
| search NOT Country IN ("United States", "Canada")
| lookup local=t asn ip AS src
| lookup nonUSlogins.csv ca.user_id AS user_id OUTPUT a.country a.ticket a.user_id
| table user_id src date_month Country Region City asn autonomous_system a.user_id a.country&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using a match but found you can't use match if there are multiple values in a single field.&lt;/P&gt;&lt;P&gt;Here is an example result currently:&lt;/P&gt;&lt;TABLE width="1387px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;user_id&lt;/TD&gt;&lt;TD&gt;src&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;date_month&lt;/TD&gt;&lt;TD&gt;Country&lt;/TD&gt;&lt;TD&gt;Region&lt;/TD&gt;&lt;TD&gt;City&lt;/TD&gt;&lt;TD&gt;asn&lt;/TD&gt;&lt;TD&gt;autonomous_system&lt;/TD&gt;&lt;TD&gt;a.user_id&lt;/TD&gt;&lt;TD&gt;a.country&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="219px"&gt;user1&lt;/TD&gt;&lt;TD width="110px"&gt;1.1.1.1&lt;/TD&gt;&lt;TD width="136px"&gt;june&lt;/TD&gt;&lt;TD width="106px"&gt;Albania&lt;/TD&gt;&lt;TD width="127px"&gt;Tirana District&lt;/TD&gt;&lt;TD width="76px"&gt;Tirana&lt;/TD&gt;&lt;TD width="74px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="199px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="217px"&gt;&lt;DIV class="multivalue-subcell"&gt;user1&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;user1&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="123px"&gt;&lt;DIV class="multivalue-subcell"&gt;Albania&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;Canada&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="219px"&gt;user1&lt;/TD&gt;&lt;TD width="110px"&gt;2.2.2.2&lt;/TD&gt;&lt;TD width="136px"&gt;june&lt;/TD&gt;&lt;TD width="106px"&gt;Germany&lt;/TD&gt;&lt;TD width="127px"&gt;Land Berlin&lt;/TD&gt;&lt;TD width="76px"&gt;Berlin&lt;/TD&gt;&lt;TD width="74px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="199px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="217px"&gt;&lt;DIV class="multivalue-subcell"&gt;user1&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;user1&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="123px"&gt;&lt;DIV class="multivalue-subcell"&gt;Albania&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;Canada&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to eliminate results where the value for user_id matches a.user_id (values in this filed will be the same when there are multiple) AND the value of Country matches one of the countries listed in a.country&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would expect to see this in the end:&lt;/P&gt;&lt;TABLE width="1387px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;user_id&lt;/TD&gt;&lt;TD&gt;src&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;date_month&lt;/TD&gt;&lt;TD&gt;Country&lt;/TD&gt;&lt;TD&gt;Region&lt;/TD&gt;&lt;TD&gt;City&lt;/TD&gt;&lt;TD&gt;asn&lt;/TD&gt;&lt;TD&gt;autonomous_system&lt;/TD&gt;&lt;TD&gt;a.user_id&lt;/TD&gt;&lt;TD&gt;a.country&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="219px"&gt;user1&lt;/TD&gt;&lt;TD width="110px"&gt;2.2.2.2&lt;/TD&gt;&lt;TD width="136px"&gt;june&lt;/TD&gt;&lt;TD width="106px"&gt;Germany&lt;/TD&gt;&lt;TD width="127px"&gt;Land Berlin&lt;/TD&gt;&lt;TD width="76px"&gt;Berlin&lt;/TD&gt;&lt;TD width="74px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="199px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="217px"&gt;&lt;DIV class="multivalue-subcell"&gt;user1&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;user1&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="123px"&gt;&lt;DIV class="multivalue-subcell"&gt;Albania&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;Canada&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 13:25:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-2-Multivalue-Fields/m-p/559805#M159059</guid>
      <dc:creator>pkohn117</dc:creator>
      <dc:date>2021-07-16T13:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Compare 2 Multivalue Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-2-Multivalue-Fields/m-p/559822#M159064</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/66716"&gt;@pkohn117&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try by adding below condition.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where 'a.user_id'=user_id AND 'a.country'=Country&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Sample Search :&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw ="user_id,src,date_month,Country,Region,City,asn,autonomous_system,a.user_id,a.country
user1,1.1.1.1,june,Albania,Tirana District,Tirana,,,user1|user1,Albania|Canada
user1,2.2.2.2,june,Germany,Land Berlin,Berlin,,,user1|user1,Albania|Canada" 
| multikv forceheader=1 | eval a_user_id=split(a_user_id,"|"),a_country=split(a_country,"|")
| rename a_user_id as a.user_id,a_country as a.country
| table user_id,src,date_month,Country,Region,City,asn,autonomous_system,a.user_id,a.country
| where 'a.user_id'=user_id AND 'a.country'=Country&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一&lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 14:51:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-2-Multivalue-Fields/m-p/559822#M159064</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-07-16T14:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Compare 2 Multivalue Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-2-Multivalue-Fields/m-p/559854#M159083</link>
      <description>&lt;P&gt;Thank you for your reply.&amp;nbsp; Adding that line made the search produce 0 results.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 17:44:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-2-Multivalue-Fields/m-p/559854#M159083</guid>
      <dc:creator>pkohn117</dc:creator>
      <dc:date>2021-07-16T17:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Compare 2 Multivalue Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-2-Multivalue-Fields/m-p/559855#M159084</link>
      <description>&lt;P&gt;Ignore my last post.&amp;nbsp; I am getting the results but it's backwards - what is showing is actually what I want to filter out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried a couple things but they didn't work:&lt;/P&gt;&lt;P&gt;| where 'a.user_id'!=user_id AND 'a.country'!=Country&lt;/P&gt;&lt;P&gt;| where NOT ('a.user_id'=user_id AND 'a.country'!=Country)&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 17:55:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-2-Multivalue-Fields/m-p/559855#M159084</guid>
      <dc:creator>pkohn117</dc:creator>
      <dc:date>2021-07-16T17:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Compare 2 Multivalue Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-2-Multivalue-Fields/m-p/559885#M159093</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/66716"&gt;@pkohn117&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where NOT ('a.user_id'=user_id AND 'a.country'=Country)&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 17 Jul 2021 04:58:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-2-Multivalue-Fields/m-p/559885#M159093</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-07-17T04:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Compare 2 Multivalue Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-2-Multivalue-Fields/m-p/560032#M159136</link>
      <description>&lt;P&gt;Ah, I can't believe I missed that.&amp;nbsp; Thank you for your help!!&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 11:48:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-2-Multivalue-Fields/m-p/560032#M159136</guid>
      <dc:creator>pkohn117</dc:creator>
      <dc:date>2021-07-19T11:48:42Z</dc:date>
    </item>
  </channel>
</rss>

