Dashboards & Visualizations

How to use a token set as an previous input value as condition for a link in drilldown

erwanlebaron
Engager

Hi

After looking on the forum, I don't find a solution to solve my issue.
I use drilldown on a table to open a link on another application.

<drilldown>
   <link target="_blank">https://cmp.<blablabla>/$row.Id$/overview</link>
</drilldown>

But the link will change depanding of a token set trough an input

  <fieldset submitButton="false">
    <input type="dropdown" token="env_portal">
      <label>Environment</label>
      <choice value="prd">PRD</choice>
      <choice value="tvp">TVP</choice>
      <initialValue>prd</initialValue>
    </input>
  </fieldset>

I tried to add a condition in the drilldown but it doesn't work

<drilldown>
     <condition match=" $env_portal$ == 'prd' ">
            <link target="_blank">https://cmp.<blablabla>/$row.Id$/overview</link>
     </condition>
     <condition match=" $env_portal$ == 'tvp' ">
            <link target="_blank">https://cmp-tvp.<blablabla>/$row.Id$/overview</link>
     </condition>
</drilldown>

How I can do a seach condition ?

Regards

0 Karma
1 Solution

vnravikumar
Champion

Hi

Check this sample

<dashboard>
  <label>drilldown</label>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults 
| eval websitename="google,yahoo" 
| makemv delim="," websitename 
| mvexpand websitename</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">cell</option>
        <drilldown>
          <condition match="$row.websitename$ == &quot;google&quot; ">
            <link target="_blank">
              <![CDATA[ http://www.google.com ]]>
            </link>
          </condition>
          <condition match="$row.websitename$ == &quot;yahoo&quot; ">
            <link target="_blank">
              <![CDATA[ http://www.yahoo.com ]]>
            </link>
          </condition>
          <condition></condition>
        </drilldown>
      </table>
    </panel>
  </row>
</dashboard>

View solution in original post

0 Karma

vnravikumar
Champion

Hi

Check this sample

<dashboard>
  <label>drilldown</label>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults 
| eval websitename="google,yahoo" 
| makemv delim="," websitename 
| mvexpand websitename</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">cell</option>
        <drilldown>
          <condition match="$row.websitename$ == &quot;google&quot; ">
            <link target="_blank">
              <![CDATA[ http://www.google.com ]]>
            </link>
          </condition>
          <condition match="$row.websitename$ == &quot;yahoo&quot; ">
            <link target="_blank">
              <![CDATA[ http://www.yahoo.com ]]>
            </link>
          </condition>
          <condition></condition>
        </drilldown>
      </table>
    </panel>
  </row>
</dashboard>
0 Karma

erwanlebaron
Engager

Perfect it works with " for a quote in the "match" !

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...