<?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: Query using inputlookup as primary, with nested query in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335482#M5024</link>
    <description>&lt;P&gt;Ultimately desired output should be: &lt;BR /&gt;
- All rows &amp;amp; columns (fields) in the lookup (roughly 12 fields), whether or not there is a relationship&lt;BR /&gt;
- (1) additional field that lists the "host" from the index where there is a match between the field clientip in the index and the field IP in the lookup table&lt;/P&gt;</description>
    <pubDate>Thu, 14 Sep 2017 16:56:28 GMT</pubDate>
    <dc:creator>tlmayes</dc:creator>
    <dc:date>2017-09-14T16:56:28Z</dc:date>
    <item>
      <title>Help with query using inputlookup as primary, with nested query</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335479#M5021</link>
      <description>&lt;P&gt;I have an inputlookup table that has a list of details, specifically IP's. The user wanted a list of all IP's that existed in both the index and the inputlookup so I wrote a query similar to the following which lists ONLY the IP's that exist in both locations.&lt;/P&gt;
&lt;P&gt;index=&lt;BR /&gt;| dedup clientip&lt;BR /&gt;| search [inputlookup file.csv | table clientip]&lt;BR /&gt;| table IP, host&lt;/P&gt;
&lt;P&gt;Now they want a query that lists all IP's in the inputlookup file in the output, noting whether or not they were found or not in the index (an eval statement?). Essentially list all hits AND misses&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 19:48:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335479#M5021</guid>
      <dc:creator>tlmayes</dc:creator>
      <dc:date>2022-05-20T19:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Query using inputlookup as primary, with nested query</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335480#M5022</link>
      <description>&lt;P&gt;If they just want to list IP's from lookup table, why not just use &lt;CODE&gt;inputlookup file.csv&lt;/CODE&gt; only? Unless you're adding few fields from index, above should work.&lt;/P&gt;

&lt;P&gt;If you're getting additional field from index, use like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=*  [inputlookup file.csv | table clientip]
| dedup clientip
|  inputlookup file.csv append=t 
| stats values(IP) as IP values(host) as host by clientip
| table IP, host clientip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Updated&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=*  [inputlookup file.csv | table IP | rename IP as clientip]
 | stats count by clientip host | fields - count | rename clientip as IP
 |  inputlookup file.csv append=t 
 | stats values(*) as * by IP
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Sep 2017 14:55:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335480#M5022</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-09-14T14:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Query using inputlookup as primary, with nested query</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335481#M5023</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; index=myindex [ | inputlookup file.csv | table clientip] | stats count by host, clientip | fields - count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you use the table as a filter assuming the number of rows is relatively low you can just do the above.&lt;/P&gt;

&lt;P&gt;If the table is large, say less than a hundred.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex | lookup file.csv clientip OUTPUTNEW clientip AS isFound | where isnotnull(isFound) | stats count by host, clientip | fields - count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Sep 2017 16:55:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335481#M5023</guid>
      <dc:creator>starcher</dc:creator>
      <dc:date>2017-09-14T16:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Query using inputlookup as primary, with nested query</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335482#M5024</link>
      <description>&lt;P&gt;Ultimately desired output should be: &lt;BR /&gt;
- All rows &amp;amp; columns (fields) in the lookup (roughly 12 fields), whether or not there is a relationship&lt;BR /&gt;
- (1) additional field that lists the "host" from the index where there is a match between the field clientip in the index and the field IP in the lookup table&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 16:56:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335482#M5024</guid>
      <dc:creator>tlmayes</dc:creator>
      <dc:date>2017-09-14T16:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Query using inputlookup as primary, with nested query</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335483#M5025</link>
      <description>&lt;P&gt;To the question of "if they just want a list of IP's from a lookup table, why not just use inputlookup".   They want a list of IP's found in the lookup table, &lt;STRONG&gt;with&lt;/STRONG&gt; a notation of which IP's are also found in the index.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 17:09:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335483#M5025</guid>
      <dc:creator>tlmayes</dc:creator>
      <dc:date>2017-09-14T17:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Query using inputlookup as primary, with nested query</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335484#M5026</link>
      <description>&lt;P&gt;Try the updated answer.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 19:03:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335484#M5026</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-09-14T19:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Query using inputlookup as primary, with nested query</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335485#M5027</link>
      <description>&lt;P&gt;Hmmm.... I am sure I am missing some detail.  Seems the output is only giving me the contents of the lookup table with none of the logic, i.e. the output of the below script is exactly the same as if I was looking at the raw CSV (no correlation indicator).  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_* host=server8 OR host=server7 OR host=server4 "services/broker/phonehome/connection" 
| rename host AS Manager, clientip AS IP
| search [inputlookup 2017-09-statistics.csv | table IP, DOMAIN, Manager]
| stats count by IP, Manager | fields - count 
| inputlookup 2017-09-statistics.csv append=t
| stats values(*) as * by IP
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Sep 2017 19:28:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335485#M5027</guid>
      <dc:creator>tlmayes</dc:creator>
      <dc:date>2017-09-14T19:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Query using inputlookup as primary, with nested query</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335486#M5028</link>
      <description>&lt;P&gt;Thanks starcher, but only give me the count.  Trying to get the output to be an updated lookup table output, with some type of notation that a record does or does not exist in the index, but maintaining all of the original lookup table records&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 19:30:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335486#M5028</guid>
      <dc:creator>tlmayes</dc:creator>
      <dc:date>2017-09-14T19:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Query using inputlookup as primary, with nested query</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335487#M5029</link>
      <description>&lt;P&gt;Few questions:&lt;/P&gt;

&lt;P&gt;1) Is it really &lt;CODE&gt;host=server7 OR server4&lt;/CODE&gt; OR should be &lt;CODE&gt;host=server7 OR host=server4&lt;/CODE&gt;? The former searches for literal string server4.&lt;BR /&gt;
2) Line 3 is adding field DOMAIN also as filter. Does your data in indexes had field DOMAIN?? &lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 19:40:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335487#M5029</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-09-14T19:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Query using inputlookup as primary, with nested query</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335488#M5030</link>
      <description>&lt;OL&gt;
&lt;LI&gt;Yes, corrected to read host=server4&lt;/LI&gt;
&lt;LI&gt;Yes, but that was just for testing limitation (get it to work).  Ultimately I want all fields in the lookup table displayed. &lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;The output should be: &lt;BR /&gt;
1. All fields found in the lookup table&lt;BR /&gt;
2. Plus the field "Manager" with an entry pulled from the index for every IP that exists in both index and lookup table.  The Manager field is a default field from the Forwarder Manager. &lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 23:26:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/335488#M5030</guid>
      <dc:creator>tlmayes</dc:creator>
      <dc:date>2017-09-14T23:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Query using inputlookup as primary, with nested query</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/598719#M5031</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have the below SPL: -&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup table1.csv where index="xxx" | fields index, host | search NOT [search index="xxx" | dedup host | table index, host]&lt;/LI-CODE&gt;&lt;P&gt;I have table2.csv with following fields: -&lt;BR /&gt;index, host, lastTime&lt;/P&gt;&lt;P&gt;I need to search the results from above SPL based on host and index in table2.csv and get the corresponding value of the column: lastTime. Thus, as the final resultset, I need: - index, host,&amp;nbsp; lastTime.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help with your suggestions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 19:38:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/598719#M5031</guid>
      <dc:creator>Taruchit</dc:creator>
      <dc:date>2022-05-20T19:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: Query using inputlookup as primary, with nested query</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/598761#M5032</link>
      <description>&lt;P&gt;Does this work for you?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup table1.csv where index="xxx" | fields index, host | search NOT [search index="xxx" | dedup host | table index, host]
| lookup table2.csv host OUTPUT lastTime&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 21 May 2022 07:18:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/598761#M5032</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-21T07:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Query using inputlookup as primary, with nested query</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/599675#M5033</link>
      <description>&lt;P&gt;Thank you sir, it works successfully.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 May 2022 18:42:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/599675#M5033</guid>
      <dc:creator>Taruchit</dc:creator>
      <dc:date>2022-05-28T18:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Query using inputlookup as primary, with nested query</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/600148#M5034</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I need your guidance for the below use case: -&lt;/P&gt;&lt;P&gt;I need to fetch list of hosts present in lookup table and not fetched in the index, but with some conditions: -&lt;/P&gt;&lt;P&gt;In lookup table, there are some hosts which have cluster and some which do not have cluster.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Case 1: -&lt;BR /&gt;Let us say at present index1 has 2 distinct IP address under field: host =&amp;gt; 10.0.0.2, 10.0.0.4&lt;/P&gt;&lt;P&gt;When we search the values against the lookup table to fetch the list of missing hosts, we should get result as: -10.0.0.5&lt;/P&gt;&lt;P&gt;Logic: - 10.0.0.1, 10.0.0.2, 10.0.0.3 are belonging to same cluster in the lookup table. Thus, if any one of them gets fetched, we are fine.&amp;nbsp;&lt;BR /&gt;10.0.0.4 does not have a cluster but it is present in the lookup table and also getting fetched.&amp;nbsp;&lt;BR /&gt;10.0.0.5 is present in lookup table but not getting reported in the index, thus, it should be given as missing.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Case 2: -&lt;BR /&gt;Let us say at present index1 has 1 IP address under field: host =&amp;gt; 10.0.0.5&lt;BR /&gt;When we search the values against the lookup table to fetch the list of missing hosts, we should get result as: -10.0.0.1, 10.0.0.2, 10.0.0.3, 10.0.0.4&lt;/P&gt;&lt;P&gt;Logic: - 10.0.0.1, 10.0.0.2, 10.0.0.3 are of the same cluster as per lookup table and none of them are getting reported in the index.&amp;nbsp;&lt;BR /&gt;10.0.0.4 is present in the lookup table without a cluster but not getting fetched in the index.&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;host&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;cluster&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;10.0.0.1&lt;/TD&gt;&lt;TD width="50%"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;10.0.0.2&lt;/TD&gt;&lt;TD width="50%"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;10.0.0.3&lt;/TD&gt;&lt;TD width="50%"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;10.0.0.4&lt;/TD&gt;&lt;TD width="50%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10.0.0.5&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 18:04:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Help-with-query-using-inputlookup-as-primary-with-nested-query/m-p/600148#M5034</guid>
      <dc:creator>Taruchit</dc:creator>
      <dc:date>2022-06-01T18:04:25Z</dc:date>
    </item>
  </channel>
</rss>

