<?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 with variable Output in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Lookup-with-variable-Output/m-p/309140#M92717</link>
    <description>&lt;P&gt;Clever Idea.&lt;/P&gt;

&lt;P&gt;May i code a lookup with 2 parameters as input?&lt;BR /&gt;
I imagine something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| lookup lookupfile.csv Date as Date,  Cluster as Cluster OUTPUTNEW &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;as &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Correct?&lt;/P&gt;

&lt;P&gt;Tks!&lt;BR /&gt;
Carmine&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jan 2018 10:04:36 GMT</pubDate>
    <dc:creator>CarmineCalo</dc:creator>
    <dc:date>2018-01-18T10:04:36Z</dc:date>
    <item>
      <title>Lookup with variable Output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-with-variable-Output/m-p/309138#M92715</link>
      <description>&lt;P&gt;Splunkers!&lt;/P&gt;

&lt;P&gt;I'm facing the following use case.&lt;/P&gt;

&lt;P&gt;I've a search that return fields like:&lt;BR /&gt;
- date (month/year)&lt;BR /&gt;
- AppID&lt;BR /&gt;
- Availability Cluster &lt;BR /&gt;
- ...&lt;/P&gt;

&lt;P&gt;In a lookup table, I've the connection b/w date (month/Year) and Availability Clusters, like&lt;/P&gt;

&lt;P&gt;Date          Cluster 1     Cluster 2     Cluster 3&lt;BR /&gt;
2016-01      100                  200             300&lt;BR /&gt;
2016-02      110                  210             310&lt;BR /&gt;
2016-03      120                  220             320&lt;BR /&gt;
....&lt;/P&gt;

&lt;P&gt;Availability Clusters in the search and in the lookup have the same domain.&lt;/P&gt;

&lt;P&gt;Now,  i need the lookup in the table the value matching both date and Availability Cluster fields related to the events (so the column to be lookup is variable, depending on "Availability Cluster" field content).&lt;BR /&gt;
How can i do?&lt;/P&gt;

&lt;P&gt;Currently the lookup looks something like, don't know how to complete the statement&lt;/P&gt;

&lt;P&gt;lookup lookupfile.csv Date as Date OUTPUTNEW ???&lt;/P&gt;

&lt;P&gt;Ideas/ suggestions are really appreciated,&lt;BR /&gt;
Tks!&lt;/P&gt;

&lt;P&gt;Carmine&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 13:56:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-with-variable-Output/m-p/309138#M92715</guid>
      <dc:creator>CarmineCalo</dc:creator>
      <dc:date>2018-01-17T13:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup with variable Output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-with-variable-Output/m-p/309139#M92716</link>
      <description>&lt;P&gt;Do you control the format/generation of the lookup table? If yes, I would suggest to make the lookup table more linear with just 3 columns, like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Date,Cluster,Value
2016-01,Cluster 1,100
2016-01,Cluster 2,200
2016-01,Cluster 3,300
....
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You'd also need to ensure that timestamp format in Date column matches your data exactly.&lt;BR /&gt;
That way it'll be easy to lookup your data (&lt;CODE&gt;...| lookup lookupfile.csv Date as Date Cluster as "Availability Cluster" OUTPUT Value&lt;/CODE&gt;).&lt;/P&gt;

&lt;P&gt;If you can't try this workaround (less efficient)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search giving fields date, AppID, "Availability Cluster"...
| join type=left Date "Availability Cluster" [| inputlookup lookupfile.csv| untable Date Cluster Value | rename Cluster as "Availability Cluster"]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Jan 2018 20:03:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-with-variable-Output/m-p/309139#M92716</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-01-17T20:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup with variable Output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-with-variable-Output/m-p/309140#M92717</link>
      <description>&lt;P&gt;Clever Idea.&lt;/P&gt;

&lt;P&gt;May i code a lookup with 2 parameters as input?&lt;BR /&gt;
I imagine something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| lookup lookupfile.csv Date as Date,  Cluster as Cluster OUTPUTNEW &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;as &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Correct?&lt;/P&gt;

&lt;P&gt;Tks!&lt;BR /&gt;
Carmine&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 10:04:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-with-variable-Output/m-p/309140#M92717</guid>
      <dc:creator>CarmineCalo</dc:creator>
      <dc:date>2018-01-18T10:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup with variable Output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-with-variable-Output/m-p/309141#M92718</link>
      <description>&lt;P&gt;yes, so you can write as &lt;BR /&gt;
    your current search giving fields date, AppID, "Availability Cluster"...| lookup lookupfile.csv Date as Date,  Cluster as "Availability Cluster" OUTPUTNEW Value &lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 10:33:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-with-variable-Output/m-p/309141#M92718</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-01-18T10:33:20Z</dc:date>
    </item>
  </channel>
</rss>

