Dashboards & Visualizations

How come my dashboard eval token is not working correctly?

jpalmiero
New Member

I have two “parallel” multivalue fields. One has friendly names and the other has the actual URL. In the example below, given the friendly name (cnn), it finds the corresponding URL:

| makeresults 
| fields - _time 
| eval friendly_names="google,facebook,cnn", urls="http://google.com,http://facebook.com,http://cnn.com" 
| makemv friendly_names delim="," 
| makemv urls delim="," 
| eval url=mvindex(urls, mvfind(friendly_names,"cnn")) 
| table url

This works exactly as I expect it to. When I try to use it in a dashboard event handler, it doesn’t work.

Anyone have any thoughts on what I might be doing wrong or an alternative way to do this? My desire is to generate some custom ugly URLs behind the scenes, but to present the user with friendly names on the dashboard.

<dashboard>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults 
| fields - _time 
| eval friendly_names="google,facebook,cnn", urls="http://google.com,http://facebook.com,http://cnn.com" 
| makemv friendly_names delim="," 
| makemv urls delim="," 
| table friendly_names</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">50</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">cell</option>
        <option name="percentagesRow">false</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
        <drilldown>
          **<condition field="friendly_names">
            <eval token="url">mvindex(urls,mvfind(friendly_names,"$click.value2$"))</eval>
            <link target="_blank">
                <![CDATA[$url|n$]]>
            </link>
          </condition>**
        </drilldown>
      </table>
    </panel>
  </row>
</dashboard>
0 Karma
1 Solution

vnravikumar
Champion

Hi @jpalmiero

Try this and let me know

<dashboard>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults 
| fields - _time 
| eval friendly_names="google,facebook,cnn", urls="http://google.com,http://facebook.com,http://cnn.com" 
| makemv friendly_names delim="," 
| makemv urls delim="," 
| eval temp=mvzip(friendly_names, urls) 
| mvexpand temp 
| makemv temp delim="," 
| eval friendly_names=mvindex(temp, 0) 
| eval urls=mvindex(temp, 1) 
| table friendly_names,urls</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">50</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">cell</option>
        <option name="percentagesRow">false</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
        <fields>["friendly_names"]</fields>
        <drilldown>
          <eval token="url">replace($row.urls$, "http://", ""</eval>
          <link target="_blank">
            <![CDATA[ http://$url$ ]]>
          </link>
        </drilldown>
      </table>
    </panel>
  </row>
</dashboard>

View solution in original post

0 Karma

vnravikumar
Champion

Hi @jpalmiero

Try this and let me know

<dashboard>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults 
| fields - _time 
| eval friendly_names="google,facebook,cnn", urls="http://google.com,http://facebook.com,http://cnn.com" 
| makemv friendly_names delim="," 
| makemv urls delim="," 
| eval temp=mvzip(friendly_names, urls) 
| mvexpand temp 
| makemv temp delim="," 
| eval friendly_names=mvindex(temp, 0) 
| eval urls=mvindex(temp, 1) 
| table friendly_names,urls</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">50</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">cell</option>
        <option name="percentagesRow">false</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
        <fields>["friendly_names"]</fields>
        <drilldown>
          <eval token="url">replace($row.urls$, "http://", ""</eval>
          <link target="_blank">
            <![CDATA[ http://$url$ ]]>
          </link>
        </drilldown>
      </table>
    </panel>
  </row>
</dashboard>
0 Karma

lakshman239
Influencer

Have you looked at using the custom urls in a lookup and tie that to actual url? [ so basically 3 columns - friendly_url, actual_url, status] and tie them up when user select friendly names?

0 Karma

jpalmiero
New Member

sorry, not exactly following you. the examples above are for demonstration purposes only. in the real example, i will have a dynamic list of host names in the multi value field and then when they click on it i want to take the into one of our host health dashboards. the URLs for the host health dashboards are messy so I want to hid them in another multi value field.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...