<?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 search multiple indexes and join field values that don't exactly match? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-indexes-and-join-field-values-that-don-t/m-p/181588#M52328</link>
    <description>&lt;P&gt;if you want to join events per domain, you need to extract the domain in a field for both type of events.&lt;BR /&gt;
By example with a rex command. Then join the 2 set of results on this new field.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=proxy | rex field=url "http(s|)://(?[-_\w\d\.]*)"&lt;BR /&gt;
| join shortdomain [&lt;BR /&gt;
search index=watchlist  | rex  field=domain "http(s|)://(?[-_\w\d\.]*)" ]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;please adapt to your actual fields formats.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Oct 2014 14:21:25 GMT</pubDate>
    <dc:creator>yannK</dc:creator>
    <dc:date>2014-10-23T14:21:25Z</dc:date>
    <item>
      <title>How to search multiple indexes and join field values that don't exactly match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-indexes-and-join-field-values-that-don-t/m-p/181586#M52326</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I need to search in multiple indexes but the field values won't match exactly so a straight join will not produce results.&lt;/P&gt;

&lt;P&gt;index=proxy Url="&lt;EM&gt;" | join [search index=watchlist "&lt;/EM&gt;".domain."*"]&lt;/P&gt;

&lt;P&gt;This is the code I am using and while syntax is ok I don't know if it is doing what I want. The proxy index has a full URL while the watchlist only has the top level of the domain i.e. &lt;A href="http://www.splunk.com"&gt;www.splunk.com&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Any help appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2014 13:23:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-indexes-and-join-field-values-that-don-t/m-p/181586#M52326</guid>
      <dc:creator>StormTrooper</dc:creator>
      <dc:date>2014-10-23T13:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to search multiple indexes and join field values that don't exactly match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-indexes-and-join-field-values-that-don-t/m-p/181587#M52327</link>
      <description>&lt;P&gt;I think you may want to do an eval and rex command on the proxy Url to pull out the top level domain. I believe the join command is going to search for an exact match and I am trying to imagine scenarios where your Url and subsearch on the join won't match but should.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2014 14:10:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-indexes-and-join-field-values-that-don-t/m-p/181587#M52327</guid>
      <dc:creator>carpga</dc:creator>
      <dc:date>2014-10-23T14:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to search multiple indexes and join field values that don't exactly match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-indexes-and-join-field-values-that-don-t/m-p/181588#M52328</link>
      <description>&lt;P&gt;if you want to join events per domain, you need to extract the domain in a field for both type of events.&lt;BR /&gt;
By example with a rex command. Then join the 2 set of results on this new field.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=proxy | rex field=url "http(s|)://(?[-_\w\d\.]*)"&lt;BR /&gt;
| join shortdomain [&lt;BR /&gt;
search index=watchlist  | rex  field=domain "http(s|)://(?[-_\w\d\.]*)" ]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;please adapt to your actual fields formats.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2014 14:21:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-indexes-and-join-field-values-that-don-t/m-p/181588#M52328</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2014-10-23T14:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to search multiple indexes and join field values that don't exactly match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-indexes-and-join-field-values-that-don-t/m-p/181589#M52329</link>
      <description>&lt;P&gt;Thank you for these answers. @ yannK I tried your code but got the following error &lt;/P&gt;

&lt;P&gt;Error in 'rex' command: Encountered the following error while compiling the regex 'http(s|)://(?[-_\w\d.]*)': Regex: unrecognized character after (? or (?- &lt;/P&gt;

&lt;P&gt;Any idea why? It all looks OK to me so I am not sure what I did wrong.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2014 13:28:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-indexes-and-join-field-values-that-don-t/m-p/181589#M52329</guid>
      <dc:creator>StormTrooper</dc:creator>
      <dc:date>2014-10-24T13:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to search multiple indexes and join field values that don't exactly match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-indexes-and-join-field-values-that-don-t/m-p/181590#M52330</link>
      <description>&lt;P&gt;The regex command was reformatted by the website,&lt;/P&gt;

&lt;P&gt;it should have a tag after the question mark, I added it back in the example below, &lt;BR /&gt;
please remove the  "underscore" to fix it  &lt;CODE&gt;_shortdomain_&lt;/CODE&gt; to &lt;CODE&gt;shortdomain&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=proxy | rex field=url "http(s|)://(?&amp;lt;_shortdomain_&amp;gt;[-_\w\d\.]*)" | join shortdomain [ search index=watchlist | rex field=domain "http(s|)://(?&amp;lt;_shortdomain_&amp;gt;[-_\w\d\.]*)" ]&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2014 16:18:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-indexes-and-join-field-values-that-don-t/m-p/181590#M52330</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2014-10-24T16:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to search multiple indexes and join field values that don't exactly match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-indexes-and-join-field-values-that-don-t/m-p/181591#M52331</link>
      <description>&lt;P&gt;Thank you for this, I got it working as I wanted.&lt;/P&gt;

&lt;P&gt;P.S. sorry for the delay in replying I haven't had a chance to look at this for a while.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2014 17:23:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-indexes-and-join-field-values-that-don-t/m-p/181591#M52331</guid>
      <dc:creator>StormTrooper</dc:creator>
      <dc:date>2014-11-13T17:23:40Z</dc:date>
    </item>
  </channel>
</rss>

