<?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: Lookup not showing results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647108#M223983</link>
    <description>&lt;P&gt;Since you seem unwilling to provide real data, here is a runanywhere example showing it working. Note that it uses outputlookup to set up critical_errors.csv so you may want to use a different name!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval _raw="errorMessage,errorMessageFilter,errorCode,errorAlertValue
Test1,Value1,1,10
Test2,Value2,2,10
Test3,Value3,3,100
Test4,Value4,5,100
Test5,Value5,5,100"
| multikv forceheader=1 
| table errorMessage,errorMessageFilter,errorCode,errorAlertValue
| outputlookup critical_errors.csv
| fields - errorMessage,errorMessageFilter,errorCode,errorAlertValue
| head 1
| eval _raw="time                        | cf_space_name | cf_app_name | msg
Wed Jun 14, 2023, 18:01:38  | space1        | app1        | Value1"
| multikv forceheader=1
| table time cf_space_name cf_app_name msg
| search 
    [| inputlookup critical_errors.csv 
    | rename errorMessageFilter as msg
    | table msg
    | format]
| lookup critical_errors.csv errorMessageFilter as msg OUTPUT errorCode,errorAlertValue&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Jun 2023 08:15:34 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2023-06-15T08:15:34Z</dc:date>
    <item>
      <title>Why is lookup not showing results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647097#M223975</link>
      <description>&lt;P&gt;Hey all,&lt;/P&gt;
&lt;P&gt;Does anyone know why this isn't working (I'm a new Splunk user)? I'm trying to show the&amp;nbsp;errorMessageFilter, errorCode and errorAlertValue from the CSV file in the table.&lt;/P&gt;
&lt;P&gt;CSV file:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;errorMessage,errorMessageFilter,errorCode,errorAlertValue&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Test1,Value1,1,10&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Test2,Value2,2,10&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Test3,Value3,3,100&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Test4,Value4,5,100&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Test5,Value5,5,100&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;And this is my query so far:&lt;/P&gt;
&lt;PRE&gt;index = index1&lt;BR /&gt;cf_app_name = app1&lt;BR /&gt;[ | inputlookup critical_errors.csv | table errorMessageFilter | rename errorMessageFilter as msg | format ] AND NOT NULL&lt;BR /&gt;| lookup critical_errors.csv errorMessageFilter OUTPUT errorCode, errorAlertValue&lt;BR /&gt;| eval time = strftime(timestamp/1000000000,"%a %b %d, %Y, %T")&lt;BR /&gt;| table time, cf_space_name, cf_app_name, msg, errorCode, errorAlertValue&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Everything in the table results shows fine, with the exception of errorCode and errorAlertValue. These 2 are empty.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 23:00:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647097#M223975</guid>
      <dc:creator>TolTest</dc:creator>
      <dc:date>2023-06-15T23:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup not showing results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647101#M223977</link>
      <description>&lt;P&gt;Try changing this line&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| lookup critical_errors.csv errorMessageFilter as msg OUTPUT errorCode, errorAlertValue&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 15 Jun 2023 07:27:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647101#M223977</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-06-15T07:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup not showing results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647102#M223978</link>
      <description>&lt;P&gt;errorCode and errorAlertValue are both still empty.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 07:29:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647102#M223978</guid>
      <dc:creator>TolTest</dc:creator>
      <dc:date>2023-06-15T07:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup not showing results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647103#M223979</link>
      <description>&lt;P&gt;So the filter [| inputlookup ...] works giving events with msg field with exactly the same values as in the errorMessageFilter column of the csv, yet the lookup with the msg field against the errorMessageFilter finds no matches?&lt;/P&gt;&lt;P&gt;Please can you give a real (although anonymised) example of an event and the line from the csv demonstrating this?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 07:41:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647103#M223979</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-06-15T07:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup not showing results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647106#M223981</link>
      <description>&lt;P&gt;CSV File:&lt;/P&gt;&lt;PRE&gt;errorMessage,errorMessageFilter,errorCode,errorAlertValue&lt;BR /&gt;Test1,Value1,1,10&lt;BR /&gt;Test2,Value2,2,10&lt;BR /&gt;Test3,Value3,3,100&lt;BR /&gt;Test4,Value4,5,100&lt;BR /&gt;Test5,Value5,5,100&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query:&lt;/P&gt;&lt;PRE&gt;index = index1&lt;BR /&gt;cf_app_name = app1&lt;BR /&gt;[ | inputlookup critical_errors.csv | table errorMessageFilter | rename errorMessageFilter as msg | format ] AND NOT NULL&lt;BR /&gt;| lookup critical_errors.csv errorMessageFilter AS msg OUTPUT errorCode, errorAlertValue&lt;BR /&gt;| eval time = strftime(timestamp/1000000000,"%a %b %d, %Y, %T")&lt;BR /&gt;| table time, cf_space_name, cf_app_name, msg, errorCode, errorAlertValue&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result event:&lt;/P&gt;&lt;PRE&gt;time                        | cf_space_name | cf_app_name | msg    | errorCode | errorAlertValue&lt;BR /&gt;Wed Jun 14, 2023, 18:01:38  | space1        | app1        | Value1 |           |&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;I hope this is what you meant.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 07:51:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647106#M223981</guid>
      <dc:creator>TolTest</dc:creator>
      <dc:date>2023-06-15T07:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup not showing results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647108#M223983</link>
      <description>&lt;P&gt;Since you seem unwilling to provide real data, here is a runanywhere example showing it working. Note that it uses outputlookup to set up critical_errors.csv so you may want to use a different name!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval _raw="errorMessage,errorMessageFilter,errorCode,errorAlertValue
Test1,Value1,1,10
Test2,Value2,2,10
Test3,Value3,3,100
Test4,Value4,5,100
Test5,Value5,5,100"
| multikv forceheader=1 
| table errorMessage,errorMessageFilter,errorCode,errorAlertValue
| outputlookup critical_errors.csv
| fields - errorMessage,errorMessageFilter,errorCode,errorAlertValue
| head 1
| eval _raw="time                        | cf_space_name | cf_app_name | msg
Wed Jun 14, 2023, 18:01:38  | space1        | app1        | Value1"
| multikv forceheader=1
| table time cf_space_name cf_app_name msg
| search 
    [| inputlookup critical_errors.csv 
    | rename errorMessageFilter as msg
    | table msg
    | format]
| lookup critical_errors.csv errorMessageFilter as msg OUTPUT errorCode,errorAlertValue&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 08:15:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647108#M223983</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-06-15T08:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup not showing results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647110#M223985</link>
      <description>&lt;P&gt;I'm still trying to figure all this out. But I did notice something.&lt;/P&gt;&lt;P&gt;If I use the following query:&lt;/P&gt;&lt;PRE&gt;| inputlookup critical_errors.csv | table errorMessageFilter | rename errorMessageFilter as msg&lt;BR /&gt;| lookup critical_errors.csv errorMessageFilter as msg OUTPUT errorCode&lt;BR /&gt;| table msg errorCode&lt;/PRE&gt;&lt;P&gt;It works fine. It shows me the msg and corresponding errorCode as it should.&amp;nbsp;&lt;BR /&gt;However, whenever I add a | format to the same query:&lt;/P&gt;&lt;PRE&gt;| inputlookup critical_errors.csv | table errorMessageFilter | rename errorMessageFilter as msg &lt;STRONG&gt;| format&lt;/STRONG&gt;&lt;BR /&gt;| lookup critical_errors.csv errorMessageFilter as msg OUTPUT errorCode&lt;BR /&gt;| table msg errorCode&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;It no longer works. Could it be because of the | format maybe?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 08:21:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647110#M223985</guid>
      <dc:creator>TolTest</dc:creator>
      <dc:date>2023-06-15T08:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup not showing results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647115#M223987</link>
      <description>&lt;P&gt;You only need format if you are using the subsearch as a filter to a search command, and even then, it isn't always required (it depends on your data and what you are trying to do with the subsearch).&lt;/P&gt;&lt;P&gt;The format parameters allow you to mess with the delimiters, around the values, around the field/value pairs, between the field/value pairs from the same line, and between the values from different lines, etc.&lt;/P&gt;&lt;P&gt;Try removing it.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 08:33:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647115#M223987</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-06-15T08:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup not showing results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647119#M223989</link>
      <description>&lt;P&gt;I use it to filter out my results, yes. And removing it from the original query seems to make no difference. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; I'm so clueless..&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 08:43:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647119#M223989</guid>
      <dc:creator>TolTest</dc:creator>
      <dc:date>2023-06-15T08:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup not showing results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647121#M223990</link>
      <description>&lt;P&gt;Perhaps it is time to share your actual events and csv because I have demonstrated the technique working with dummy data?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 08:45:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647121#M223990</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-06-15T08:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup not showing results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647136#M223994</link>
      <description>&lt;P&gt;For wildcard lookups, you need to use advanced options and set WILDCARD matching for the lookup field&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITWhisperer_0-1686825825575.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/25861i7300E284A1EE20DA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ITWhisperer_0-1686825825575.png" alt="ITWhisperer_0-1686825825575.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 10:44:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-lookup-not-showing-results/m-p/647136#M223994</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-06-15T10:44:02Z</dc:date>
    </item>
  </channel>
</rss>

