<?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: Could not construct lookup in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Could-not-construct-lookup/m-p/503506#M140065</link>
    <description>&lt;P&gt;I've realised the problem here is that some values in my lookup file are blank which causes the lookup to fail.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Oct 2019 11:00:05 GMT</pubDate>
    <dc:creator>gopenshaw</dc:creator>
    <dc:date>2019-10-28T11:00:05Z</dc:date>
    <item>
      <title>Could not construct lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-not-construct-lookup/m-p/503505#M140064</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm having an issue with a splunk lookup and I can't work out what the issue is. I have a lookup file, that among other things contains a mac address field and a hostname field&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mac, nt_host
aabbccddeeff, machine1
a1b1c1d1e1f1, machine2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;etc.&lt;/P&gt;

&lt;P&gt;I then have a search which returns data like the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   MAC: AA:BB:CC:DD:EE:FF
   interface: ge-X/X/XX
   switch: SWITCHNAME
   timestamp: 2019-10-14T09:02:02+00:00
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm trying to match the mac in the lookup table and return the nt_host:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=os source="logfile" host="logfilehost"
| eval mac = lower(trim(replace(MAC, ":", "")))
| lookup lookupfile mac OUTPUT nt_host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I get the following error:&lt;BR /&gt;
 Streamed search execute failed because: Error in 'lookup' command: Could not construct lookup 'lookupfile, mac, OUTPUT, dns'. See search.log for more details..&lt;/P&gt;

&lt;P&gt;If i run this search it works:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=os source="logfile" host="logfilehost"
| eval mac = lower(trim(replace(MAC, ":", "")))
| table mac
| lookup lookupfile mac OUTPUT nt_host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but a subsequent stats command then returns the same error again. I'm unsure whats happening here and I see no errors in the search log.&lt;/P&gt;

&lt;P&gt;No idea what I'm missing here.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 09:51:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-not-construct-lookup/m-p/503505#M140064</guid>
      <dc:creator>gopenshaw</dc:creator>
      <dc:date>2019-10-14T09:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Could not construct lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-not-construct-lookup/m-p/503506#M140065</link>
      <description>&lt;P&gt;I've realised the problem here is that some values in my lookup file are blank which causes the lookup to fail.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2019 11:00:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-not-construct-lookup/m-p/503506#M140065</guid>
      <dc:creator>gopenshaw</dc:creator>
      <dc:date>2019-10-28T11:00:05Z</dc:date>
    </item>
  </channel>
</rss>

