<?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: Help required regarding lookup in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407468#M172812</link>
    <description>&lt;P&gt;Are you trying to use this in dashboard?&lt;/P&gt;

&lt;P&gt;|makeresults | eval Name="Get", Subcategory="Vehicle" | inputlookup search_query.csv Name Subcategory OUTPUT Query &lt;/P&gt;

&lt;P&gt;the above will return your search (Query).&lt;/P&gt;</description>
    <pubDate>Mon, 25 Feb 2019 17:46:37 GMT</pubDate>
    <dc:creator>lakshman239</dc:creator>
    <dc:date>2019-02-25T17:46:37Z</dc:date>
    <item>
      <title>Help required regarding lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407467#M172811</link>
      <description>&lt;P&gt;I have a lookup(search_query.csv)  with data as below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Name Subcategory Query
Get      Vehicle          index=abc I where api=fig I table api msg
Post    Summary      index=cfg I where api=his I table api msg
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;[Note : lookup has 1000's row data such as above]&lt;/P&gt;

&lt;P&gt;Now I would want to run a query using the above lookup,when name and subcategory matches,it has to execute the corresponding query. (i.e., use Name and Subcategory as input and get the query as output and use the output query as the search).&lt;/P&gt;

&lt;P&gt;Is it possible?????&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 16:57:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407467#M172811</guid>
      <dc:creator>deepusoundar</dc:creator>
      <dc:date>2019-02-25T16:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help required regarding lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407468#M172812</link>
      <description>&lt;P&gt;Are you trying to use this in dashboard?&lt;/P&gt;

&lt;P&gt;|makeresults | eval Name="Get", Subcategory="Vehicle" | inputlookup search_query.csv Name Subcategory OUTPUT Query &lt;/P&gt;

&lt;P&gt;the above will return your search (Query).&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 17:46:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407468#M172812</guid>
      <dc:creator>lakshman239</dc:creator>
      <dc:date>2019-02-25T17:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help required regarding lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407469#M172813</link>
      <description>&lt;P&gt;Yes,am tryinh to use this for dashboard only..&lt;/P&gt;

&lt;P&gt;I just do not want to get the query as result instead i would want to execute the query and see the result of that query..&lt;/P&gt;

&lt;P&gt;For example,&lt;BR /&gt;
For  an event matching Name and subcategory,it has to fetch the query from lookup and execute that search and show the result..&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 18:21:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407469#M172813</guid>
      <dc:creator>deepusoundar</dc:creator>
      <dc:date>2019-02-25T18:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help required regarding lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407470#M172814</link>
      <description>&lt;P&gt;How are you planning to execute the query and how are you selecting/providing those Name/Subcategory field values? Are they going to come from a dropdown or something?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 19:05:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407470#M172814</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-02-25T19:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Help required regarding lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407471#M172815</link>
      <description>&lt;P&gt;To my knowledge, you cannot pass the whole query from the output of lookup for a search.&lt;BR /&gt;
But if you have query with fixed variables as you mentioned in the sample and constant query, you can try something like this:&lt;BR /&gt;
 index=abc I where api=fig I table api msg&lt;BR /&gt;
Split the fields from the query into individual fields &lt;BR /&gt;
&lt;STRONG&gt;ex:&lt;/STRONG&gt; index_from_lookup=abc , api_from_lookup=fig, so you lookup looks like this &lt;/P&gt;

&lt;P&gt;Name Subcategory index_from_lookup   api_from_lookup&lt;BR /&gt;
 Get      Vehicle          abc                               fig&lt;BR /&gt;
 Post    Summary      cfg                                his&lt;/P&gt;

&lt;P&gt;and then pass them to map command after the lookup. Sample is shown below. I have used "where" instead of "lookup command" for sample as I don't have the csv to do lookup&lt;/P&gt;

&lt;P&gt;|makeresults&lt;BR /&gt;
| eval Name="Get" | eval category="Vehicle" | eval index_from_lookup="_internal" | eval file_from_lookup="shelper"&lt;BR /&gt;
|append &lt;BR /&gt;
[|makeresults&lt;BR /&gt;
| eval Name="Post" | eval category="Summary" | eval index_from_lookup="_internal" | eval file_from_lookup="messages"]&lt;BR /&gt;
| where Name="Post" AND category="Summary"&lt;BR /&gt;
| map search="search index=$index_from_lookup$ file=$file_from_lookup$ | table method, output_mode"&lt;/P&gt;

&lt;P&gt;If you have limited searches in lookup and if you can create macros for each search, you can try this after you have the macro name from output of lookup&lt;BR /&gt;
| map search="search &lt;CODE&gt;$macro_name_from_lookup_output$&lt;/CODE&gt;" (This will not be an option for you if you have 1000 different queries in your lookup).&lt;/P&gt;

&lt;P&gt;Hope it helps.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:25:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407471#M172815</guid>
      <dc:creator>cvssravan</dc:creator>
      <dc:date>2020-09-29T23:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help required regarding lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407472#M172816</link>
      <description>&lt;P&gt;The name and subcategory as they come in the event,when they get matched,they are used as input of lookup and query as the output and that query has to be executed&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 21:25:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407472#M172816</guid>
      <dc:creator>deepusoundar</dc:creator>
      <dc:date>2019-02-25T21:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Help required regarding lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407473#M172817</link>
      <description>&lt;P&gt;You cannot do that in the search pipeline to my knowledge. you may be able to achieve that in a dashboard, but having a search which matches Name and subcategory as input against your events returning the Query. And when user clicks it, you can show/run the search to return results in another window/panel in the dashboard [ drill-down search]&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 09:46:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407473#M172817</guid>
      <dc:creator>lakshman239</dc:creator>
      <dc:date>2019-02-26T09:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Help required regarding lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407474#M172818</link>
      <description>&lt;P&gt;Can yu help me on how to proceed with it&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 10:01:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407474#M172818</guid>
      <dc:creator>deepusoundar</dc:creator>
      <dc:date>2019-02-26T10:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help required regarding lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407475#M172819</link>
      <description>&lt;P&gt;pls download the &lt;A href="https://splunkbase.splunk.com/app/1603/"&gt;https://splunkbase.splunk.com/app/1603/&lt;/A&gt; app and install on your dev instance and you can look for 'Drilldown Elements' and it has samples in Drilldown Link Dashboard. A few others can also help you.&lt;/P&gt;

&lt;P&gt;You can your base search which is something like index=* | inputlookup search_query.csv  Name subcategory OUTPUT query .. this will show results in the first dashboard panel. When users click any row, you can then use token [ will have contents of query] and pass it to drill-down search to run that and return results in another panel within the same dashboard.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 11:33:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407475#M172819</guid>
      <dc:creator>lakshman239</dc:creator>
      <dc:date>2019-02-26T11:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Help required regarding lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407476#M172820</link>
      <description>&lt;P&gt;if you are happy with the solution, pls accept to close the thread.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 17:33:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-required-regarding-lookup/m-p/407476#M172820</guid>
      <dc:creator>lakshman239</dc:creator>
      <dc:date>2019-02-26T17:33:14Z</dc:date>
    </item>
  </channel>
</rss>

