<?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: How to match host fields between two separate lookups? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-host-fields-between-two-separate-lookups/m-p/641198#M222150</link>
    <description>&lt;P&gt;If you put two lists of names next to each other, what are the chances two names in the same row will match?&amp;nbsp; That's what's happening here.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Appendpipe&lt;/FONT&gt; is the answer to a rare set of problems.&amp;nbsp; This is not one of them.&lt;/P&gt;&lt;P&gt;Pick one lookup as the base and use the &lt;FONT face="georgia,palatino"&gt;lookup&lt;/FONT&gt; command to see if the name exists in the other file.&amp;nbsp; The command is case-insensitive so no need to shift case when comparing.&amp;nbsp; If the name doesn't exist in the 2nd file then the &lt;FONT face="courier new,courier"&gt;lookup&lt;/FONT&gt; command will return NULL.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup lookup1.csv
| rex field=host "(?&amp;lt;host&amp;gt;[^.]+)\."
| dedup host
| lookup lookup2.csv Host as host OUTPUTNEW Host
| eval results = if(isnotnull(Host), "hit", "miss")
| table host Host results&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Apr 2023 21:57:50 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2023-04-24T21:57:50Z</dc:date>
    <item>
      <title>How to match host fields between two separate lookups?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-host-fields-between-two-separate-lookups/m-p/641180#M222140</link>
      <description>&lt;P&gt;Hello all,&lt;BR /&gt;&lt;BR /&gt;I have two lookups-- lookup1.csv with a "host" field and lookup2.csv with a "Host" field&lt;BR /&gt;&lt;BR /&gt;I want to see if any hosts match&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Pretty silly, but IM blanking on this for some reason&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is how I was doing it, but it doesn't seem to find the hit (even when I add it in a matching host purposefully for testing)&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;| inputlookup lookup1.csv&lt;BR /&gt;| rex field=host "(?&amp;lt;host&amp;gt;[^.]+)\."&lt;BR /&gt;| dedup host&lt;BR /&gt;| appendpipe [ | inputlookup lookup2.csv ]&lt;BR /&gt;| table host Host&lt;BR /&gt;| eval results = if(match(upper(Host),upper(host)), "hit", "miss")&lt;BR /&gt;| table host Host results&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 19:04:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-host-fields-between-two-separate-lookups/m-p/641180#M222140</guid>
      <dc:creator>spluzer</dc:creator>
      <dc:date>2023-04-24T19:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to match host fields between two separate lookups?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-host-fields-between-two-separate-lookups/m-p/641198#M222150</link>
      <description>&lt;P&gt;If you put two lists of names next to each other, what are the chances two names in the same row will match?&amp;nbsp; That's what's happening here.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Appendpipe&lt;/FONT&gt; is the answer to a rare set of problems.&amp;nbsp; This is not one of them.&lt;/P&gt;&lt;P&gt;Pick one lookup as the base and use the &lt;FONT face="georgia,palatino"&gt;lookup&lt;/FONT&gt; command to see if the name exists in the other file.&amp;nbsp; The command is case-insensitive so no need to shift case when comparing.&amp;nbsp; If the name doesn't exist in the 2nd file then the &lt;FONT face="courier new,courier"&gt;lookup&lt;/FONT&gt; command will return NULL.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup lookup1.csv
| rex field=host "(?&amp;lt;host&amp;gt;[^.]+)\."
| dedup host
| lookup lookup2.csv Host as host OUTPUTNEW Host
| eval results = if(isnotnull(Host), "hit", "miss")
| table host Host results&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 21:57:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-host-fields-between-two-separate-lookups/m-p/641198#M222150</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-04-24T21:57:50Z</dc:date>
    </item>
  </channel>
</rss>

