<?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 How can we compare two dynamic field values from two lookups in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-compare-two-dynamic-field-values-from-two-lookups/m-p/506624#M141734</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am urgently looking for a help . I have one field object_name which is present in lookup X1.csv and has values like&amp;nbsp;&lt;BR /&gt;object_name&lt;BR /&gt;&lt;SPAN&gt;GRM MGT Shortfirer Appointment&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Blasting Security Register Test&lt;BR /&gt;&lt;/SPAN&gt;Morning Schedule&lt;BR /&gt;&lt;BR /&gt;The other lookup(X2.csv)&amp;nbsp; has the column object_name , which has values like below&lt;BR /&gt;Appointment&lt;BR /&gt;Schedule&lt;BR /&gt;Blasting&lt;BR /&gt;I have to match the two columns and give the results , wherever object_name contains *keyword* of object_name from secondlookup.. The field values can be in upper case or lower case or a combination.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jun 2020 04:16:36 GMT</pubDate>
    <dc:creator>Trishla</dc:creator>
    <dc:date>2020-06-30T04:16:36Z</dc:date>
    <item>
      <title>How can we compare two dynamic field values from two lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-compare-two-dynamic-field-values-from-two-lookups/m-p/506624#M141734</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am urgently looking for a help . I have one field object_name which is present in lookup X1.csv and has values like&amp;nbsp;&lt;BR /&gt;object_name&lt;BR /&gt;&lt;SPAN&gt;GRM MGT Shortfirer Appointment&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Blasting Security Register Test&lt;BR /&gt;&lt;/SPAN&gt;Morning Schedule&lt;BR /&gt;&lt;BR /&gt;The other lookup(X2.csv)&amp;nbsp; has the column object_name , which has values like below&lt;BR /&gt;Appointment&lt;BR /&gt;Schedule&lt;BR /&gt;Blasting&lt;BR /&gt;I have to match the two columns and give the results , wherever object_name contains *keyword* of object_name from secondlookup.. The field values can be in upper case or lower case or a combination.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 04:16:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-compare-two-dynamic-field-values-from-two-lookups/m-p/506624#M141734</guid>
      <dc:creator>Trishla</dc:creator>
      <dc:date>2020-06-30T04:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: How can we compare two dynamic field values from two lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-compare-two-dynamic-field-values-from-two-lookups/m-p/506796#M141766</link>
      <description>&lt;P&gt;It's not clear what exactly you are looking up from each lookup file. So when you have a row with&lt;/P&gt;&lt;P&gt;object_name="&lt;SPAN&gt;Blasting Security Register Test"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;then are you wanting to see if any of the 4 words&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Blasting&lt;/LI&gt;&lt;LI&gt;Security&lt;/LI&gt;&lt;LI&gt;Register&lt;/LI&gt;&lt;LI&gt;Test&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;exist in the second lookup file?&lt;/P&gt;&lt;P&gt;What you can do is based on the following example&lt;/P&gt;&lt;P&gt;This will create a lookup file with the 4 words separated onto individual rows with a value n=1 for each&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval object_name=split("Blasting Security Register Test"," ")
| mvexpand object_name
| table object_name
| eval n=1
| outputlookup mylookup.csv&lt;/LI-CODE&gt;&lt;P&gt;This second snippet with then create a test sample where there are two rows, one with the name as above and the other with a name where the fields are not present.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults count=2
| eval t=1 
| accum t
| eval object_name=if(t=1,split("Blasting Security Register Test"," "),split("GRM MGT Shortfirer Appointment "," "))
| fields - t
| lookup mylookup.csv object_name&lt;/LI-CODE&gt;&lt;P&gt;Essentially what this is doing is to split the words from the object_name and then do a multivalue lookup of those words into the lookup file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;By then testing the existence of n, you will know if the match is found&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where !isnull(n)&lt;/LI-CODE&gt;&lt;P&gt;You will need to create not just the lookup file, but also the lookup definition where you say that lookups are case insensitive, so you do the lookup on the definition NOT the lookup file itself.&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 22:22:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-compare-two-dynamic-field-values-from-two-lookups/m-p/506796#M141766</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-06-30T22:22:49Z</dc:date>
    </item>
  </channel>
</rss>

