<?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: Why is the lookup command not giving results that exist in the lookup table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-lookup-command-not-giving-results-that-exist-in-the/m-p/329967#M98223</link>
    <description>&lt;P&gt;Well that CLI command didn't seem to find anything but creating a new lookup with just a single row with the user in question seems to work.&lt;/P&gt;

&lt;P&gt;I did try removing the lookup table and rebuilding it with fresh data which brought the size down to around 80mb from the several hundred it was before but I still have the same issue.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Aug 2017 19:04:34 GMT</pubDate>
    <dc:creator>patelaa</dc:creator>
    <dc:date>2017-08-02T19:04:34Z</dc:date>
    <item>
      <title>Why is the lookup command not giving results that exist in the lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-lookup-command-not-giving-results-that-exist-in-the/m-p/329964#M98220</link>
      <description>&lt;P&gt;I have a lookup table with user data called id_lookup.csv&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;username,hostname,ip
user1,computer1,1.1.1.1
user2,computer2,2.2.2.2
user3,computer3,3.3.3.3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I use that lookup table to help populate identity data for a search like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex sourcetype=mysourcetype
| search username=*
| lookup local=true id_lookup.csv username OUTPUT hostname,ip
| table hostname, ip, username
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The issue is that the table of results doesn't get populated with the 2 fields I'm searching in the lookup for all the results when the users I'm searching the lookup table for are definitely in there.&lt;/P&gt;

&lt;P&gt;So my results will look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;hostname,ip,username
 , ,user1
computer2,2.2.2.2,user2
 , ,user3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But if I search the lookup table using inputlookup &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup id_lookup.csv
| search username="user1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get the results&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;username,hostname,ip
user1,computer1,1.1.1.1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And when running a 1 off search using the lookup command for further testing I get the same inconsistent results&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval username="user1"
| lookup local=true id_lookup.csv username OUTPUT hostname, ip
| table hostname, ip, username
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which gives&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;hostname,ip,username
 , ,user1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;All the fields match up, permissions check out, transforms.conf looks right for that particular lookup stanza.&lt;/P&gt;

&lt;P&gt;Does anyone know what else I can do to troubleshoot or know if this is a possible bug? The only thing I can think of is the csv file is fairly large but it still doesn't make sense why it would return the results for some entries and not others.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 21:18:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-lookup-command-not-giving-results-that-exist-in-the/m-p/329964#M98220</guid>
      <dc:creator>patelaa</dc:creator>
      <dc:date>2017-07-25T21:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the lookup command not giving results that exist in the lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-lookup-command-not-giving-results-that-exist-in-the/m-p/329965#M98221</link>
      <description>&lt;P&gt;You probably have a malformed CSV file; once the lookup hits a bad row, it bails out completely.  You can use this as a starting point:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/306569/corrupt-csv-header-how-to-find-the-corrupted-csv.html#answer-306586"&gt;https://answers.splunk.com/answers/306569/corrupt-csv-header-how-to-find-the-corrupted-csv.html#answer-306586&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 22:12:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-lookup-command-not-giving-results-that-exist-in-the/m-p/329965#M98221</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-25T22:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the lookup command not giving results that exist in the lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-lookup-command-not-giving-results-that-exist-in-the/m-p/329966#M98222</link>
      <description>&lt;P&gt;@patelaa - you can test @woodcock's idea by just creating another lookup table and seeing if your results are consistent.  I'd suggest using the username from the first table as your input (but nothing else), and a single fixed output column.  If the problem disappears, then he nailed it.  If the problem persists, then it may be something wonky about the keys, or it may be something else that isn't obvious (like one of the letters is in a cyrillic alphabet or something...) &lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 01:01:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-lookup-command-not-giving-results-that-exist-in-the/m-p/329966#M98222</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-07-26T01:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the lookup command not giving results that exist in the lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-lookup-command-not-giving-results-that-exist-in-the/m-p/329967#M98223</link>
      <description>&lt;P&gt;Well that CLI command didn't seem to find anything but creating a new lookup with just a single row with the user in question seems to work.&lt;/P&gt;

&lt;P&gt;I did try removing the lookup table and rebuilding it with fresh data which brought the size down to around 80mb from the several hundred it was before but I still have the same issue.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 19:04:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-lookup-command-not-giving-results-that-exist-in-the/m-p/329967#M98223</guid>
      <dc:creator>patelaa</dc:creator>
      <dc:date>2017-08-02T19:04:34Z</dc:date>
    </item>
  </channel>
</rss>

