<?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 Why does adding head (1==1) fix this strange lookup error? in Splunk Enterprise Security</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Why-does-adding-head-1-1-fix-this-strange-lookup-error/m-p/467483#M7008</link>
    <description>&lt;P&gt;Both queries work on our non ES server; however, only the first query works on our ES server.&lt;/P&gt;

&lt;P&gt;This query works in both places:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myIndexFile 
| head (1==1)
| lookup myserverlist my_host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This query throws the following error on our ES server:&lt;BR /&gt;
Streamed search execute failed because: "[IndexServerName] Error in 'lookup' command: Could not construct lookup  'myserverlist , my_host'. See search.log for more details.." I've looked at the search.log file and found nothing useful.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myIndexFile 
| lookup myserverlist my_host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 06 Apr 2020 18:48:21 GMT</pubDate>
    <dc:creator>compuchip</dc:creator>
    <dc:date>2020-04-06T18:48:21Z</dc:date>
    <item>
      <title>Why does adding head (1==1) fix this strange lookup error?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Why-does-adding-head-1-1-fix-this-strange-lookup-error/m-p/467483#M7008</link>
      <description>&lt;P&gt;Both queries work on our non ES server; however, only the first query works on our ES server.&lt;/P&gt;

&lt;P&gt;This query works in both places:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myIndexFile 
| head (1==1)
| lookup myserverlist my_host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This query throws the following error on our ES server:&lt;BR /&gt;
Streamed search execute failed because: "[IndexServerName] Error in 'lookup' command: Could not construct lookup  'myserverlist , my_host'. See search.log for more details.." I've looked at the search.log file and found nothing useful.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myIndexFile 
| lookup myserverlist my_host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Apr 2020 18:48:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Why-does-adding-head-1-1-fix-this-strange-lookup-error/m-p/467483#M7008</guid>
      <dc:creator>compuchip</dc:creator>
      <dc:date>2020-04-06T18:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why does adding head (1==1) fix this strange lookup error?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Why-does-adding-head-1-1-fix-this-strange-lookup-error/m-p/467484#M7009</link>
      <description>&lt;P&gt;The &lt;CODE&gt;lookup&lt;/CODE&gt; command is a &lt;STRONG&gt;distributable streaming command&lt;/STRONG&gt; when &lt;STRONG&gt;local=false&lt;/STRONG&gt;, which is the default setting. And distributable streaming command runs on indexer servers. So in your second query lookup is running on indexer server: &lt;CODE&gt;[IndexServerName]&lt;/CODE&gt; and failing as it is not created there. You need to provide &lt;STRONG&gt;local=true&lt;/STRONG&gt; in lookup command to run it on search heads.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myIndexFile 
| lookup local=true myserverlist my_host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Why the first query works?&lt;/STRONG&gt;&lt;BR /&gt;
it is using &lt;CODE&gt;head&lt;/CODE&gt; command which is a &lt;STRONG&gt;centralized streaming command&lt;/STRONG&gt; which only runs on search heads. Before &lt;CODE&gt;head&lt;/CODE&gt; command executed indexers send  the results to the search head and all the next commands will be run on search head only. So in this case &lt;CODE&gt;lookup&lt;/CODE&gt; will be run on search head so it works.&lt;/P&gt;

&lt;P&gt;Check this link to understand this better: &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/Search/Writebettersearches#Parallel_processing_example"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.2/Search/Writebettersearches#Parallel_processing_example&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Check below links for more info:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/Search/Typesofcommands"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.2/Search/Typesofcommands&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/SearchReference/Commandsbytype"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.2/SearchReference/Commandsbytype&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 06:10:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Why-does-adding-head-1-1-fix-this-strange-lookup-error/m-p/467484#M7009</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-04-07T06:10:44Z</dc:date>
    </item>
  </channel>
</rss>

