<?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 get my lookup search to return FieldC from a mylookup.csv on match of FieldA? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-my-lookup-search-to-return-FieldC-from-a-mylookup-csv/m-p/264370#M79361</link>
    <description>&lt;P&gt;Assume that your logfile contains one field called ID, and that the ID field needs to match FieldA. Then your search could be&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="logfile" ID=*
| lookup mylookup FieldA as ID OUTPUT FieldB 
| where isnotnull(FieldB)
| table ID FieldB other_fields_from_logfile
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 06 Dec 2016 22:47:49 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2016-12-06T22:47:49Z</dc:date>
    <item>
      <title>How to get my lookup search to return FieldC from a mylookup.csv on match of FieldA?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-my-lookup-search-to-return-FieldC-from-a-mylookup-csv/m-p/264369#M79360</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;

&lt;P&gt;I have a lookup called mylookup based on mylookup.csv containing 3 fields FieldA, FieldB and FieldC.  I am trying to match on FieldA and return FieldC on a match.&lt;/P&gt;

&lt;P&gt;If I run &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup mylookup  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get the lookup contents displayed properly.&lt;/P&gt;

&lt;P&gt;If I run &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="logfile" [inputlookup mylookup | fields FieldA | rename FieldA as Result ]| table Result
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get the interesting events back where the lookup value in FieldA matches the value in the event field Result.&lt;/P&gt;

&lt;P&gt;If I run&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="logfile" | lookup mylookup FieldA as Result OUTPUT FieldB as WhatIWant | search WhatIWant=* | table FieldA, FieldB, Result, WhatIWant
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It does not return any results.&lt;/P&gt;

&lt;P&gt;What is strange for me is I run a different lookup against another log file and it works fine.&lt;BR /&gt;
mylookup2 against logfile2.&lt;/P&gt;

&lt;P&gt;Any help is much appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2016 21:10:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-my-lookup-search-to-return-FieldC-from-a-mylookup-csv/m-p/264369#M79360</guid>
      <dc:creator>AnthonyTibaldi</dc:creator>
      <dc:date>2016-12-06T21:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to get my lookup search to return FieldC from a mylookup.csv on match of FieldA?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-my-lookup-search-to-return-FieldC-from-a-mylookup-csv/m-p/264370#M79361</link>
      <description>&lt;P&gt;Assume that your logfile contains one field called ID, and that the ID field needs to match FieldA. Then your search could be&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="logfile" ID=*
| lookup mylookup FieldA as ID OUTPUT FieldB 
| where isnotnull(FieldB)
| table ID FieldB other_fields_from_logfile
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Dec 2016 22:47:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-my-lookup-search-to-return-FieldC-from-a-mylookup-csv/m-p/264370#M79361</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2016-12-06T22:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to get my lookup search to return FieldC from a mylookup.csv on match of FieldA?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-my-lookup-search-to-return-FieldC-from-a-mylookup-csv/m-p/264371#M79362</link>
      <description>&lt;P&gt;Yes, I would see where that should work but it is not.&lt;/P&gt;

&lt;P&gt;Inputlookup seems to find the events but lookup does not.&lt;/P&gt;

&lt;P&gt;Also as mentioned what is really strange is another lookup works fine.&lt;/P&gt;

&lt;P&gt;mylookup2 against logfile2.&lt;/P&gt;

&lt;P&gt;The only difference is mylookup2.csv was added through the UI and mylookup.csv was populated from a search.  I have ensured permissions on the lookup table file and definition are the same for mylookup and mylookup2.&lt;/P&gt;

&lt;P&gt;Not sure what else to do?&lt;/P&gt;

&lt;P&gt;Thanks for the feedback.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2016 13:44:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-my-lookup-search-to-return-FieldC-from-a-mylookup-csv/m-p/264371#M79362</guid>
      <dc:creator>AnthonyTibaldi</dc:creator>
      <dc:date>2016-12-07T13:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to get my lookup search to return FieldC from a mylookup.csv on match of FieldA?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-my-lookup-search-to-return-FieldC-from-a-mylookup-csv/m-p/264372#M79363</link>
      <description>&lt;P&gt;Lookups are case-sensitive by default. Could this be the issue?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2016 19:41:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-my-lookup-search-to-return-FieldC-from-a-mylookup-csv/m-p/264372#M79363</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2016-12-07T19:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to get my lookup search to return FieldC from a mylookup.csv on match of FieldA?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-my-lookup-search-to-return-FieldC-from-a-mylookup-csv/m-p/264373#M79364</link>
      <description>&lt;P&gt;I have quadruple checked spelling and case.   That is not it.  &lt;/P&gt;

&lt;P&gt;I'll keep searching.  Thanks for the advice.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2016 20:07:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-my-lookup-search-to-return-FieldC-from-a-mylookup-csv/m-p/264373#M79364</guid>
      <dc:creator>AnthonyTibaldi</dc:creator>
      <dc:date>2016-12-07T20:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to get my lookup search to return FieldC from a mylookup.csv on match of FieldA?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-my-lookup-search-to-return-FieldC-from-a-mylookup-csv/m-p/264374#M79365</link>
      <description>&lt;P&gt;OK,  I found that my search is correct and does work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="logfile" | lookup mylookup FieldA as Result OUTPUT FieldB as WhatIWant | search WhatIWant=* | table FieldA, FieldB, Result, WhatIWant
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This works.  I think I was having a problem with my search failing or possibly a delay in my proxy logs.  In any case the search above does work.  So would the search  lguinn offered as a suggestion.&lt;/P&gt;

&lt;P&gt;The issue was not with the search it was with the environment.  Hope this helps anyone with similar trouble. &lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2016 15:45:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-my-lookup-search-to-return-FieldC-from-a-mylookup-csv/m-p/264374#M79365</guid>
      <dc:creator>AnthonyTibaldi</dc:creator>
      <dc:date>2016-12-12T15:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to get my lookup search to return FieldC from a mylookup.csv on match of FieldA?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-my-lookup-search-to-return-FieldC-from-a-mylookup-csv/m-p/264375#M79366</link>
      <description>&lt;P&gt;Hi @AnthonyTibaldi - Glad to hear that you've found the solution to your question. Please don't forget to click "Accept" below your answer so that other users can easily find it. And be sure to up-vote any helpful comments from lguinn too. Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2016 17:59:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-my-lookup-search-to-return-FieldC-from-a-mylookup-csv/m-p/264375#M79366</guid>
      <dc:creator>aaraneta_splunk</dc:creator>
      <dc:date>2016-12-12T17:59:50Z</dc:date>
    </item>
  </channel>
</rss>

