<?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: Using Drilldown to search for a value in a look up to set a token in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Using-Drilldown-to-search-for-a-value-in-a-look-up-to-set-a/m-p/334744#M21711</link>
    <description>&lt;P&gt;Cheers. Great stuff.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jul 2017 22:59:12 GMT</pubDate>
    <dc:creator>robertlynch2020</dc:creator>
    <dc:date>2017-07-27T22:59:12Z</dc:date>
    <item>
      <title>Using Drilldown to search for a value in a look up to set a token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Using-Drilldown-to-search-for-a-value-in-a-look-up-to-set-a/m-p/334742#M21709</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I am trying to set a token from a drilldown.&lt;/P&gt;

&lt;P&gt;I am able to to this, however the value that comes back is only for display, the real value is in a lookup table.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;NICKNAME    Human_Name_Nickname
mx  MX_BASIC
smcrisk_engine  RISK_ENGINE
mxtraderepository_engine    MX_TRADE_REPO_ENGINE
smcobjectrepository_engine  SM_ENGINE
mxmlexchange_mxtaskxa   MXMLEXCHANGE
mxdealscanner_engine    DEAL_SCANNER
mx_cesar    CESAR
mx_marketdata_repository_engine MARKET_DATA
mxprocessingscript  PROCESSING_SCRIPT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So i need to take the value on the screen go to the look up and comeback with the real value.&lt;BR /&gt;
I am trying to do this by taking $trellis.value$, putting it into a lookuptable and getting back the correct answer.&lt;/P&gt;

&lt;P&gt;So for example, i display "MX_BASIC", i want to set the token to "mx" as this is the underlining value i need to pass into the token.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;drilldown&amp;gt;
          &amp;lt;!--set token="form.NICKNAME_TOKEN"&amp;gt;$trellis.value$&amp;lt;/set--&amp;gt;
          &amp;lt;set token="SINGLE_CLICK_NICKNAME"&amp;gt;ON&amp;lt;/set&amp;gt;
           &amp;lt;eval token="form.NICKNAME_TOKEN"&amp;gt;| inputlookup  TEST_MXTIMING_NICKNAME.csv |  search Human_Name_Nickname = $trellis.value$ | fields - Human_Name_Nickname&amp;lt;/eval&amp;gt;
        &amp;lt;/drilldown&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Jul 2017 12:00:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Using-Drilldown-to-search-for-a-value-in-a-look-up-to-set-a/m-p/334742#M21709</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2017-07-27T12:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using Drilldown to search for a value in a look up to set a token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Using-Drilldown-to-search-for-a-value-in-a-look-up-to-set-a/m-p/334743#M21710</link>
      <description>&lt;P&gt;@robertlynch2020, you can pass on the token from trellis drilldown to a search which can perform inputlookup to fetch the result and set the form variable through Search Event Handler.&lt;/P&gt;

&lt;P&gt;Add the following new search to your dashboard (below description)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;| inputlookup  TEST_MXTIMING_NICKNAME.csv where Human_Name_Nickname = "$trellis.value$" | fields NICKNAME
      &amp;lt;/query&amp;gt;
      &amp;lt;progress&amp;gt;
          &amp;lt;set token="form.NICKNAME_TOKEN"&amp;gt;$result.NICKNAME$&amp;lt;/set&amp;gt;
      &amp;lt;/progress&amp;gt;
    &amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Modify your Trellis drilldown code to pass on clicked value as token to the search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;drilldown&amp;gt;
       &amp;lt;set token="tokHumanNameNickName"&amp;gt;$trellis.value$&amp;lt;/set&amp;gt;
       &amp;lt;set token="SINGLE_CLICK_NICKNAME"&amp;gt;ON&amp;lt;/set&amp;gt;
    &amp;lt;/drilldown&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;PS: Use of eval to set token can only perform eval functions that too with some restrictions which you should check in Splunk Documentation: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Viz/tokens#Define_token_filtering_and_formatting"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Viz/tokens#Define_token_filtering_and_formatting&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 17:30:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Using-Drilldown-to-search-for-a-value-in-a-look-up-to-set-a/m-p/334743#M21710</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-07-27T17:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using Drilldown to search for a value in a look up to set a token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Using-Drilldown-to-search-for-a-value-in-a-look-up-to-set-a/m-p/334744#M21711</link>
      <description>&lt;P&gt;Cheers. Great stuff.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 22:59:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Using-Drilldown-to-search-for-a-value-in-a-look-up-to-set-a/m-p/334744#M21711</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2017-07-27T22:59:12Z</dc:date>
    </item>
  </channel>
</rss>

