<?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: Search for data in different indexes and only return data is ip filed is same in both in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-for-data-in-different-indexes-and-only-return-data-is-ip/m-p/484773#M135700</link>
    <description>&lt;P&gt;If I was thinking about the explanation, I was late.&lt;BR /&gt;
The way is the same. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 18 Jan 2020 01:42:32 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-01-18T01:42:32Z</dc:date>
    <item>
      <title>Search for data in different indexes and only return data is ip filed is same in both</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-data-in-different-indexes-and-only-return-data-is-ip/m-p/484770#M135697</link>
      <description>&lt;P&gt;index=notable |rename src as ip | stats count by ip &lt;BR /&gt;
| JOIN type=inner ip [search index="abcd" "tags.Dev:"cluster1 OR index="abcd" "tags.Dev:"=cluster2&lt;BR /&gt;
| stats count by ip]&lt;/P&gt;

&lt;P&gt;if ip is in notable index and cluster1 return ip AND if ip in notable index and cluster2 return ip&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jan 2020 00:47:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-data-in-different-indexes-and-only-return-data-is-ip/m-p/484770#M135697</guid>
      <dc:creator>jrprez1804</dc:creator>
      <dc:date>2020-01-18T00:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: Search for data in different indexes and only return data is ip filed is same in both</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-data-in-different-indexes-and-only-return-data-is-ip/m-p/484771#M135698</link>
      <description>&lt;P&gt;hello there,&lt;/P&gt;

&lt;P&gt;first, you can always do something like that: &lt;CODE&gt;index=notable | stats count by src as ip_count | rename src as ip&lt;/CODE&gt; which will perform much better.&lt;BR /&gt;
but now for your &lt;CODE&gt;join&lt;/CODE&gt; question.&lt;BR /&gt;
there are couple (or more) ways to achieve, but the overall idea is to first bring all the results to one place with a wider search, and then slice and dice as you wish. for example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=notable src=*) OR (index="abcd" "tags.Dev:"cluster1 OR index="abcd" "tags.Dev:"=cluster2)
| eval normalized_ip = coalesce(ip,src)
| stats dc(index) as unique_indexes by normalized_ip
| where unique_indexes &amp;gt; 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;play around with the data after you capture all of it, and suite yourself with the approach you like. there are many ways to go about this one...&lt;/P&gt;

&lt;P&gt;hope it helps&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jan 2020 01:33:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-data-in-different-indexes-and-only-return-data-is-ip/m-p/484771#M135698</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2020-01-18T01:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Search for data in different indexes and only return data is ip filed is same in both</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-data-in-different-indexes-and-only-return-data-is-ip/m-p/484772#M135699</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=notable OR (index="abcd" ("tags.Dev:"cluster1 OR "tags.Dev:"=cluster2))
| eval ip=coalesce(src,ip) 
| stats count dc(index) as flag by ip 
| where flag &amp;gt; 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, @jrprez1804&lt;BR /&gt;
This query searches two indexes and  tallies by each ip.&lt;BR /&gt;
That time, it is checked the indexes where the ip belongs.&lt;BR /&gt;
and  Excludes ips that belongs one index.&lt;/P&gt;

&lt;P&gt;How about this?&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jan 2020 01:40:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-data-in-different-indexes-and-only-return-data-is-ip/m-p/484772#M135699</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-18T01:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: Search for data in different indexes and only return data is ip filed is same in both</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-data-in-different-indexes-and-only-return-data-is-ip/m-p/484773#M135700</link>
      <description>&lt;P&gt;If I was thinking about the explanation, I was late.&lt;BR /&gt;
The way is the same. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jan 2020 01:42:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-data-in-different-indexes-and-only-return-data-is-ip/m-p/484773#M135700</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-18T01:42:32Z</dc:date>
    </item>
  </channel>
</rss>

