Dashboards & Visualizations

How to set a token value to a column?

dbcase
Motivator

Hi,

I have a table result set. What I would like to do is set the value of the token to the first column no matter where the user clicks on the row.

Here is the table result set
alt text

If the user Clicks on any field on the first row the token should be set to SerComm_Camera_iCamera. If the user clicks on any field in the second row the token should be set to SerComm_Camera_OC810 and so on

My non-working attempt at this looks like this:

<row>
    <panel>
      <title>Camera Status</title>
      <table>
        <title>Beta Overview - Select model for more detail</title>
        <search>
          <query>index="betadb_cameras" _index_earliest=-5m _index_latest=now  | where like('Internal Flag', "$accountType_tok$") and like('Broadband Online',"$broadbandType_tok$") | stats count("Camera Model") as "Model Count", count(eval('Camera Offline' != "null")) as "Model Offline", sum("CommFail Count") AS "CommFail Totals" by "Camera Model" | eval "Percent Offline" = round(('Model Offline'/'Model Count'*100), 2)." %" | table "Camera Model" "Model Count" "Model Offline" "Percent Offline" "CommFail Totals" | sort by "Percent Offline" desc, "Model Offline" desc</query>
          <earliest>0</earliest>
          <latest></latest>
        </search>
        <option name="count">50</option>
        <option name="drilldown">row</option>
        <option name="rowNumbers">true</option>
        <drilldown>
          <condition field="*">
            <set token="modelSpecificSearch">$result.col1$</set>
          </condition>

        </drilldown>
      </table>
      <table depends="$modelSpecificSearch$">
        <title>Model Specific Results - Select firmware for more detail</title>
        <search>
          <query>index="betadb_cameras" _index_earliest=-5m _index_latest=now "Camera Model" = "$modelSpecificSearch$" | where like('Internal Flag', "$accountType_tok$") and like('Broadband Online',"$broadbandType_tok$") | stats values("Camera Model") AS "Camera Model", count("Camera Firmware") as "Firmware Count", count(eval('Camera Offline' != "null")) as "Firmware Offline", sum("CommFail Count") AS "CommFail Total" by "Camera Firmware"| eval "Percent Offline" = round(('Firmware Offline'/'Firmware Count'*100), 2)." %" | table "Camera Model" "Camera Firmware" "Firmware Count" "Firmware Offline" "Percent Offline" "CommFail Total" | sort by "Camera Firmware" desc</query>
        </search>
        <option name="count">50</option>
        <option name="drilldown">row</option>
        <option name="rowNumbers">true</option>
1 Solution

somesoni2
Revered Legend

Try this

......
        <drilldown>
           <set token="modelSpecificSearch">$row.Camera Model$</set> 
         </drilldown>
......

OR

......
        <drilldown>
           <set token="modelSpecificSearch">$click.value$</set> 
         </drilldown>
......

Reference: http://docs.splunk.com/Documentation/Splunk/6.5.2/Viz/tokens#Predefined_tokens_for_dynamic_drilldown

View solution in original post

somesoni2
Revered Legend

Try this

......
        <drilldown>
           <set token="modelSpecificSearch">$row.Camera Model$</set> 
         </drilldown>
......

OR

......
        <drilldown>
           <set token="modelSpecificSearch">$click.value$</set> 
         </drilldown>
......

Reference: http://docs.splunk.com/Documentation/Splunk/6.5.2/Viz/tokens#Predefined_tokens_for_dynamic_drilldown

dbcase
Motivator

Wow, that is very clean! Thanks Somesoni2!!! (again)

0 Karma
Get Updates on the Splunk Community!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...