<?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 How to join two search using condition  if ,case, or where? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-using-condition-if-case-or-where/m-p/609403#M211908</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;I am new to splunk and&amp;nbsp; struggling to join two searches based on conditions .eg. left join&amp;nbsp; with field 1 from index2&amp;nbsp; if field1!=" " otherwise&amp;nbsp; left join with field 2 from index 2. Field 2 is only present in index 2.and Field 1 is common in&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I&amp;nbsp; have two spl&amp;nbsp; giving right result when executing separately . I don't know how to merge both spl based on above condition to get complete result.&amp;nbsp; Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Aug 2022 13:49:13 GMT</pubDate>
    <dc:creator>Cs80</dc:creator>
    <dc:date>2022-08-15T13:49:13Z</dc:date>
    <item>
      <title>How to join two search using condition  if ,case, or where?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-using-condition-if-case-or-where/m-p/609403#M211908</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;I am new to splunk and&amp;nbsp; struggling to join two searches based on conditions .eg. left join&amp;nbsp; with field 1 from index2&amp;nbsp; if field1!=" " otherwise&amp;nbsp; left join with field 2 from index 2. Field 2 is only present in index 2.and Field 1 is common in&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I&amp;nbsp; have two spl&amp;nbsp; giving right result when executing separately . I don't know how to merge both spl based on above condition to get complete result.&amp;nbsp; Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2022 13:49:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-using-condition-if-case-or-where/m-p/609403#M211908</guid>
      <dc:creator>Cs80</dc:creator>
      <dc:date>2022-08-15T13:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: Join two search using  condition  if  ,case or where</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-using-condition-if-case-or-where/m-p/609409#M211909</link>
      <description>&lt;P&gt;There's no such thing as a "conditional join" in Splunk.&amp;nbsp; The join must always be on the same field(s).&amp;nbsp; Any conditions must be satisfied before the join is performed.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;&amp;lt;search 1&amp;gt;&amp;gt;
| eval joinField = field1
| join type=left joinField [
  &amp;lt;&amp;lt;search 2&amp;gt;&amp;gt;
  | eval joinField = coalesce(field1, field2)
  ]&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 13 Aug 2022 12:31:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-using-condition-if-case-or-where/m-p/609409#M211909</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-08-13T12:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Join two search using  condition  if  ,case or where</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-using-condition-if-case-or-where/m-p/609412#M211911</link>
      <description>&lt;P&gt;As an extension of what &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt; already wrote - in Splunk usually join is not the way to go. Try to describe what you have (it's best if you give some examples of the events you have) and what you want to achieve. We'll see what can be done &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Aug 2022 18:03:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-using-condition-if-case-or-where/m-p/609412#M211911</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-08-13T18:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: Join two search using  condition  if  ,case or where</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-using-condition-if-case-or-where/m-p/609413#M211912</link>
      <description>&lt;P&gt;I tried using coalesce but no luck.&amp;nbsp; I am trying to find all domains in our scope&amp;nbsp; using many different indexes&amp;nbsp; and multiple joins. I am currently using two separate searches and&amp;nbsp; both search queries are working fine when executing separately. I want to join both search queries to get complete result. I tried using&amp;nbsp;coalesce with eval Domain in my search where some of&amp;nbsp; public IP are missing .I want to use Private_IP when Public_IP is not there. Then I plan to Join both queries based on Domain.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;| eval Domain= coalesce( Public_IP, Private_IP)&lt;/STRONG&gt;&amp;nbsp; . After using coalesce command&amp;nbsp; new field Domain showing up&amp;nbsp; empty space as in Public _IP. In other works new filed Domain is replicating Public_IP .&amp;nbsp; I also tried using if&amp;nbsp; with eval bit&amp;nbsp; no luck.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;| eval Domain=if(isnull(Public_IP),Private_IP, Public_IP&lt;/STRONG&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Aug 2022 20:11:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-using-condition-if-case-or-where/m-p/609413#M211912</guid>
      <dc:creator>Cs80</dc:creator>
      <dc:date>2022-08-13T20:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Join two search using  condition  if  ,case or where</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-using-condition-if-case-or-where/m-p/609414#M211913</link>
      <description>&lt;P&gt;That would meant that you do not have a field named Private_IP in events which do not have Public_IP. Remember that with Splunk case in field names is important.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Aug 2022 20:34:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-search-using-condition-if-case-or-where/m-p/609414#M211913</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-08-13T20:34:00Z</dc:date>
    </item>
  </channel>
</rss>

