<?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: Join if one of two fields match a lookup in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Join-if-one-of-two-fields-match-a-lookup/m-p/405408#M117189</link>
    <description>&lt;P&gt;what about maybe just using the lookup command...maybe something like this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| base search 
|table Website "IP address"
| lookup input.csv Address as Website OUTPUT Date
| lookup input.csv Address as 'IP address' OUTPUTNEW Date
| table Website "IP address" Date
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 06 Jun 2019 00:13:26 GMT</pubDate>
    <dc:creator>maciep</dc:creator>
    <dc:date>2019-06-06T00:13:26Z</dc:date>
    <item>
      <title>Join if one of two fields match a lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-if-one-of-two-fields-match-a-lookup/m-p/405407#M117188</link>
      <description>&lt;P&gt;Hi there, many thanks for reading this far and for any insights you can give.&lt;/P&gt;

&lt;P&gt;I have a base search which returns a number of fields including "Website" and "IP address"&lt;/P&gt;

&lt;P&gt;In addition, there is a lookup table that has two fields: &lt;BR /&gt;
Address (with either a website or IP address)&lt;BR /&gt;
Date (which strangely has a date).&lt;/P&gt;

&lt;P&gt;What I would like to do is add the Date to records where the Address is like either "Website" OR "IP address"&lt;BR /&gt;&lt;BR /&gt;
(e.g. Address could contain BBC to cover bbc.co.uk, bbc.com, bbc.co.uk/news, bbc.com/sports etc.).&lt;/P&gt;

&lt;P&gt;If there is another way to avoid using join at all that would be a bonus&lt;/P&gt;

&lt;P&gt;My search is currently along line of the following but it returns 0 results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|base search |table Website "IP address"
|join type=left 
[inputlookup input.csv |fields Address Date |eval Website= Address |eval "IP address"= Address]
|table Website "IP address" Date
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have tried putting fields names on the Join part and renaming Address, but this only joins for one field not either.&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2019 16:13:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-if-one-of-two-fields-match-a-lookup/m-p/405407#M117188</guid>
      <dc:creator>ChrisCLewis</dc:creator>
      <dc:date>2019-06-05T16:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Join if one of two fields match a lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-if-one-of-two-fields-match-a-lookup/m-p/405408#M117189</link>
      <description>&lt;P&gt;what about maybe just using the lookup command...maybe something like this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| base search 
|table Website "IP address"
| lookup input.csv Address as Website OUTPUT Date
| lookup input.csv Address as 'IP address' OUTPUTNEW Date
| table Website "IP address" Date
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Jun 2019 00:13:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-if-one-of-two-fields-match-a-lookup/m-p/405408#M117189</guid>
      <dc:creator>maciep</dc:creator>
      <dc:date>2019-06-06T00:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Join if one of two fields match a lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-if-one-of-two-fields-match-a-lookup/m-p/405409#M117190</link>
      <description>&lt;P&gt;Good afternoon,&lt;BR /&gt;
Thank you for your answer &lt;/P&gt;

&lt;P&gt;It is working perfectly where there is an exact match.  The trouble is is for entries such as "bbc" (which are needed to cover multiple sites bbc.co.uk and bbc.com).&lt;/P&gt;

&lt;P&gt;At present the fields in the lookup are not set for wildcard use so can't use "&lt;EM&gt;bbc&lt;/EM&gt;", and not sure if I can get the "holders of the keys" to make the changes &lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 12:40:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-if-one-of-two-fields-match-a-lookup/m-p/405409#M117190</guid>
      <dc:creator>ChrisCLewis</dc:creator>
      <dc:date>2019-06-06T12:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Join if one of two fields match a lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-if-one-of-two-fields-match-a-lookup/m-p/405410#M117191</link>
      <description>&lt;P&gt;yeah, if you can't get the wildcard option for the lookup, this problem does become a bit different.  Would the wildcard match always be the domain prefix?  If so, then you could maybe create a field for that and add another lookup.  Maybe like this?  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| base search 
| table Website "IP address"
| eval Domain  = mvindex(split(Website,"."),0)
| lookup input.csv Address as Website OUTPUT Date
| lookup input.csv Address as Domain OUTPUTNEW Date
| lookup input.csv Address as 'IP address' OUTPUTNEW Date
| table Website "IP address" Date
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Jun 2019 13:07:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-if-one-of-two-fields-match-a-lookup/m-p/405410#M117191</guid>
      <dc:creator>maciep</dc:creator>
      <dc:date>2019-06-06T13:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Join if one of two fields match a lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-if-one-of-two-fields-match-a-lookup/m-p/405411#M117192</link>
      <description>&lt;P&gt;Got the wildcard sorted and working correctly now.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 09:36:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-if-one-of-two-fields-match-a-lookup/m-p/405411#M117192</guid>
      <dc:creator>ChrisCLewis</dc:creator>
      <dc:date>2019-09-05T09:36:32Z</dc:date>
    </item>
  </channel>
</rss>

