<?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 select 2 different lookup table based on different cloud name in Splunk Cloud Platform</title>
    <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-select-2-different-lookup-table-based-on-different-cloud/m-p/340988#M804</link>
    <description>&lt;P&gt;Since the searches are all &lt;CODE&gt;inputlookups&lt;/CODE&gt;, we don't have to worry about the expense of the search. &lt;/P&gt;

&lt;P&gt;Therefore, we can just add a filter before each of the joins that will kill the records from the other cloud, and then append the two searches together.  This assumes the search will be in a panel and there is a token named &lt;CODE&gt;mycloudtoken&lt;/CODE&gt; that contains either "test1" or "test2"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup lookup_test1 
| join type=inner 
    [ | inputlookup info_lookup where cloudname="test1" 
      | where cloudname="$mycloudtoken$"
      | dedup cloudname hostname 
      | rename hostname as host_name 
      | table cloudname host_name 
      ]
| append 
    [ | inputlookup lookup_test2 
      | join type=inner 
        [ | inputlookup info_lookup where cloudname="test2" 
          | where cloudname="$mycloudtoken$"
          | dedup cloudname 
          | table cloudname ] 
      ]
| sort metrics_id 
| table metrics_id host_name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 18 Sep 2017 14:16:11 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-09-18T14:16:11Z</dc:date>
    <item>
      <title>How to select 2 different lookup table based on different cloud name</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-select-2-different-lookup-table-based-on-different-cloud/m-p/340986#M802</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;I would like to call different lookup table based on the cloudname in my search query.&lt;/P&gt;

&lt;P&gt;For ex:&lt;/P&gt;

&lt;P&gt;if cloudname=test1, then call the below search query&lt;/P&gt;

&lt;P&gt;|inputlookup lookup_test1 | join type=inner [ | inputlookup info_lookup where cloudname=test1 | dedup cloudname hostname | rename hostname as host_name | table cloudname host_name ] | sort metrics_id | table metrics_id host_name&lt;/P&gt;

&lt;P&gt;else,&lt;/P&gt;

&lt;P&gt;if cloudname=test2, then call the below search query&lt;/P&gt;

&lt;P&gt;|inputlookup lookup_test2 | join type=inner [ | inputlookup info_lookup where cloudname=test2 | dedup cloudname  | table cloudname ] | sort metrics_id | table metrics_id host_name&lt;/P&gt;

&lt;P&gt;So, my query is, how can I combine both these queries such that if cloudname=test1 then, the first lookup (lookup_test1) is called else, if cloudname=test2 then the second lookup (lookup_test2) is called&lt;/P&gt;

&lt;P&gt;regards,&lt;BR /&gt;
Santosh&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:48:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-select-2-different-lookup-table-based-on-different-cloud/m-p/340986#M802</guid>
      <dc:creator>santosh_hb</dc:creator>
      <dc:date>2020-09-29T15:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to select 2 different lookup table based on different cloud name</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-select-2-different-lookup-table-based-on-different-cloud/m-p/340987#M803</link>
      <description>&lt;P&gt;Is this going to be in a panel with tokens?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 14:09:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-select-2-different-lookup-table-based-on-different-cloud/m-p/340987#M803</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-09-18T14:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to select 2 different lookup table based on different cloud name</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-select-2-different-lookup-table-based-on-different-cloud/m-p/340988#M804</link>
      <description>&lt;P&gt;Since the searches are all &lt;CODE&gt;inputlookups&lt;/CODE&gt;, we don't have to worry about the expense of the search. &lt;/P&gt;

&lt;P&gt;Therefore, we can just add a filter before each of the joins that will kill the records from the other cloud, and then append the two searches together.  This assumes the search will be in a panel and there is a token named &lt;CODE&gt;mycloudtoken&lt;/CODE&gt; that contains either "test1" or "test2"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup lookup_test1 
| join type=inner 
    [ | inputlookup info_lookup where cloudname="test1" 
      | where cloudname="$mycloudtoken$"
      | dedup cloudname hostname 
      | rename hostname as host_name 
      | table cloudname host_name 
      ]
| append 
    [ | inputlookup lookup_test2 
      | join type=inner 
        [ | inputlookup info_lookup where cloudname="test2" 
          | where cloudname="$mycloudtoken$"
          | dedup cloudname 
          | table cloudname ] 
      ]
| sort metrics_id 
| table metrics_id host_name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Sep 2017 14:16:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-select-2-different-lookup-table-based-on-different-cloud/m-p/340988#M804</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-09-18T14:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to select 2 different lookup table based on different cloud name</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-select-2-different-lookup-table-based-on-different-cloud/m-p/340989#M805</link>
      <description>&lt;P&gt;yes it will be in the same panel that uses the tokens.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 08:47:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-select-2-different-lookup-table-based-on-different-cloud/m-p/340989#M805</guid>
      <dc:creator>santosh_hb</dc:creator>
      <dc:date>2017-09-21T08:47:13Z</dc:date>
    </item>
  </channel>
</rss>

