<?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 pass a variable as the output column name in the lookup command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-a-variable-as-the-output-column-name-in-the-lookup/m-p/530746#M149933</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/69443"&gt;@ddelmont&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The lookup syntax is not correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;field/column names which are used after output keyword are expected to be in lookup and those field values will be returned if there is any match against the field you specify before output keyword.&lt;/P&gt;&lt;P&gt;The correct syntax is as below:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| lookup &amp;lt;lookup-table-name&amp;gt; &amp;lt;lookup-field1&amp;gt; AS &amp;lt;event-field1&amp;gt;, &amp;lt;lookup-field2&amp;gt; AS &amp;lt;event-field2&amp;gt; OUTPUTNEW &amp;lt;lookup-destfield1&amp;gt; AS &amp;lt;event-destfield1&amp;gt;, &amp;lt;lookup-destfield2&amp;gt; AS &amp;lt;event-destfield2&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.1.0/SearchReference/Lookup" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.1.0/SearchReference/Lookup&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=cwEzgY0lAts&amp;nbsp;" target="_blank"&gt;https://www.youtube.com/watch?v=cwEzgY0lAts&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 05:16:06 GMT</pubDate>
    <dc:creator>thambisetty</dc:creator>
    <dc:date>2020-11-25T05:16:06Z</dc:date>
    <item>
      <title>How to pass a variable as the output column name in the lookup command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-a-variable-as-the-output-column-name-in-the-lookup/m-p/530741#M149931</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Having trouble understanding lookups.&amp;nbsp; Any help would be appreciated.&lt;/P&gt;&lt;P&gt;If I have a table with ID and User columns and run below it works.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|makeresults
|eval ID="1"
|lookup test.csv ID output User&lt;/LI-CODE&gt;&lt;P&gt;But if I add a second eval and run:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|makeresults
|eval ID="1"
|eval column="User"
|lookup test.csv ID output column&lt;/LI-CODE&gt;&lt;P&gt;I get and error "Count not find all of the specified destination fields in the lookup table".&lt;/P&gt;&lt;P&gt;I need to be able to evaluate the column before passing it to the lookup command.&amp;nbsp; Is that possible?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 04:00:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-a-variable-as-the-output-column-name-in-the-lookup/m-p/530741#M149931</guid>
      <dc:creator>ddelmont</dc:creator>
      <dc:date>2020-11-25T04:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a variable as the output column name in the lookup command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-a-variable-as-the-output-column-name-in-the-lookup/m-p/530746#M149933</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/69443"&gt;@ddelmont&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The lookup syntax is not correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;field/column names which are used after output keyword are expected to be in lookup and those field values will be returned if there is any match against the field you specify before output keyword.&lt;/P&gt;&lt;P&gt;The correct syntax is as below:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| lookup &amp;lt;lookup-table-name&amp;gt; &amp;lt;lookup-field1&amp;gt; AS &amp;lt;event-field1&amp;gt;, &amp;lt;lookup-field2&amp;gt; AS &amp;lt;event-field2&amp;gt; OUTPUTNEW &amp;lt;lookup-destfield1&amp;gt; AS &amp;lt;event-destfield1&amp;gt;, &amp;lt;lookup-destfield2&amp;gt; AS &amp;lt;event-destfield2&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.1.0/SearchReference/Lookup" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.1.0/SearchReference/Lookup&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=cwEzgY0lAts&amp;nbsp;" target="_blank"&gt;https://www.youtube.com/watch?v=cwEzgY0lAts&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 05:16:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-a-variable-as-the-output-column-name-in-the-lookup/m-p/530746#M149933</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-11-25T05:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a variable as the output column name in the lookup command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-a-variable-as-the-output-column-name-in-the-lookup/m-p/530831#M149951</link>
      <description>&lt;P&gt;So it's only possible to use a variable before the output and not after?&amp;nbsp; Anyway around this?&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 14:15:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-a-variable-as-the-output-column-name-in-the-lookup/m-p/530831#M149951</guid>
      <dc:creator>ddelmont</dc:creator>
      <dc:date>2020-11-25T14:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a variable as the output column name in the lookup command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-a-variable-as-the-output-column-name-in-the-lookup/m-p/530941#M149984</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/69443"&gt;@ddelmont&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;yes, you can define field which you would like look up against field from lookup table. Fields mentioned after output/outputnew are output of matched field.&lt;/P&gt;&lt;P&gt;why do you want to define variable in output?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 06:10:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-a-variable-as-the-output-column-name-in-the-lookup/m-p/530941#M149984</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-11-26T06:10:58Z</dc:date>
    </item>
  </channel>
</rss>

