<?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: Check field against two lookup tables in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411553#M118713</link>
    <description>&lt;P&gt;Click &lt;CODE&gt;Accept&lt;/CODE&gt; on your answer and the &lt;CODE&gt;UpVote&lt;/CODE&gt; anything else that was useful.&lt;/P&gt;</description>
    <pubDate>Sun, 21 Apr 2019 14:49:29 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-04-21T14:49:29Z</dc:date>
    <item>
      <title>Check field against two lookup tables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411544#M118704</link>
      <description>&lt;P&gt;I have two lookup tables that may contain the hostname of an IP address&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| lookup cmdb_ci_server_lookup ip_address as src output fqdn as orig_host
| lookup lansweeper_assets_lookup IPAddress as src output AssetName as orig_host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, if AssetName in lansweeper_assets_lookup is null, the output of orig_host will be null as well.  I know I can assign them different names and do an eval to combine but was hoping to get a more elegant way. any ideas?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:07:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411544#M118704</guid>
      <dc:creator>mkarimi17</dc:creator>
      <dc:date>2020-09-30T00:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Check field against two lookup tables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411545#M118705</link>
      <description>&lt;P&gt;what exactly is the goal? to join cmdb_ci_server_lookup to lansweeper_assets_lookup by ip_address/IPAddress and fill the null values of AssetName/orig_host from lansweeper_assets_lookup?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:12:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411545#M118705</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2020-09-30T00:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Check field against two lookup tables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411546#M118706</link>
      <description>&lt;P&gt;Which value takes precedence, once from lansweeper_assets_lookup OR one from cmdb_ci_server_lookup (assuming both returns value)?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:12:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411546#M118706</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-30T00:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: Check field against two lookup tables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411547#M118707</link>
      <description>&lt;P&gt;the goal is to get the hostname from either lookup table.  not looking to combine them, although maybe I should just do that in a different search&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 20:18:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411547#M118707</guid>
      <dc:creator>mkarimi17</dc:creator>
      <dc:date>2019-04-18T20:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: Check field against two lookup tables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411548#M118708</link>
      <description>&lt;P&gt;both should have the same data, so it doesn't really matter to me. but sometimes one is null and the other isn't &lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 20:19:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411548#M118708</guid>
      <dc:creator>mkarimi17</dc:creator>
      <dc:date>2019-04-18T20:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Check field against two lookup tables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411549#M118709</link>
      <description>&lt;P&gt;Cool. So in your lookup command, you're using OUTPUT option to get orig_host, replace it with OUTPUTNEW.&lt;/P&gt;

&lt;P&gt;If the OUTPUT clause is specified, the output lookup fields overwrite existing fields. If the OUTPUTNEW clause is specified, the lookup is not performed for events in which the output fields already exist.&lt;/P&gt;

&lt;P&gt;So your queries will be like this&lt;/P&gt;

&lt;P&gt;| lookup cmdb_ci_server_lookup ip_address as src outputnew fqdn as orig_host&lt;BR /&gt;
 | lookup lansweeper_assets_lookup IPAddress as src outputnew AssetName as orig_host&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:12:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411549#M118709</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-30T00:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Check field against two lookup tables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411550#M118710</link>
      <description>&lt;P&gt;If you're just trying to bring in hostname and not combine the tables together, I'd use coalesce. I'd just do something like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|join src type=left [|inputlookup cmdb_ci_server_lookup|fields ip_address fqdn|rename ip_address as src] 
|join src type=left [|inputlookup lansweeper_assets_lookup |fields IPAddress AssetName|rename IPAddress as src]
|eval orig_host=coalesce(fqdn,AssetName)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Apr 2019 20:29:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411550#M118710</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2019-04-18T20:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Check field against two lookup tables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411551#M118711</link>
      <description>&lt;P&gt;ah! totally forgot about outputnew instead of output.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 21:32:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411551#M118711</guid>
      <dc:creator>mkarimi17</dc:creator>
      <dc:date>2019-04-18T21:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Check field against two lookup tables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411552#M118712</link>
      <description>&lt;P&gt;thanks but this is basically what I had and it's super long.  outputnew did the trick! &lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 21:32:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411552#M118712</guid>
      <dc:creator>mkarimi17</dc:creator>
      <dc:date>2019-04-18T21:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Check field against two lookup tables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411553#M118713</link>
      <description>&lt;P&gt;Click &lt;CODE&gt;Accept&lt;/CODE&gt; on your answer and the &lt;CODE&gt;UpVote&lt;/CODE&gt; anything else that was useful.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2019 14:49:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Check-field-against-two-lookup-tables/m-p/411553#M118713</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-04-21T14:49:29Z</dc:date>
    </item>
  </channel>
</rss>

