Dashboards & Visualizations

How to Pass a token value to a visualization option ?

Muwafi
Path Finder

Hello,

I am using custom image map viz and I want to pass the token "image" to define different image name depending on the search result

   <panel>
  <title>Site Structure</title>
  <viz type="custom-image-map-viz.map_viz">
    <search>

      <query> |MY SEARCH

     <done>

            <set token="image">$result.site_image_type$</set>

          </done>

        </search>

        <option name="custom-image-map-viz.map_viz.allPopups">0</option>

        <option name="custom-image-map-viz.map_viz.backgroundColor">#006d9c</option>

        <option name="custom-image-map-viz.map_viz.defaultHeight">600</option>
        <option name="custom-image-map-viz.map_viz.drilldown">0</option>
        <option name="custom-image-map-viz.map_viz.focusClicked">0</option>
        <option name="custom-image-map-viz.map_viz.fullScreen">0</option>
        <option name="custom-image-map-viz.map_viz.mapCenterX">300</option>
        <option name="custom-image-map-viz.map_viz.mapCenterY">380</option>
        <option name="custom-image-map-viz.map_viz.mapCenterZoom">0</option>
        <option name="custom-image-map-viz.map_viz.mapHeight">701</option>
        <option name="custom-image-map-viz.map_viz.mapImage">$image$</option>
        <option name="custom-image-map-viz.map_viz.mapWidth">658</option>
        <option name="custom-image-map-viz.map_viz.maxZoom">0</option>
        <option name="custom-image-map-viz.map_viz.minZoom">0</option>
        <option name="custom-image-map-viz.map_viz.multiplePopups">0</option>
        <option name="custom-image-map-viz.map_viz.scrollWheelZoom">0</option>
        <option name="custom-image-map-viz.map_viz.showPath">1</option>
        <option name="custom-image-map-viz.map_viz.showPointerCoordinates">0</option>
        <option name="custom-image-map-viz.map_viz.unfocusedOpacity">0.1</option>
        <option name="drilldown">none</option>
        <option name="height">804</option>
        <option name="refresh.display">progressbar</option>
        <option name="trellis.enabled">0</option>
        <option name="trellis.scales.shared">1</option>
        <option name="trellis.size">medium</option>

      </viz>

    </panel>

Is this possible ?? to change any Viz option based on a token?

Thanks

Tags (1)
0 Karma
1 Solution

gaurav_maniar
Builder

Hi,

Logically your code is correct.
If its not working, than the issue may be because of value mis-match of image and mapImage required value.

Let me know if any other details are required.

Accept & up-vote the answer if it helps.

happy splunking.....!!!!!!

View solution in original post

0 Karma

gaurav_maniar
Builder

Hi,

Logically your code is correct.
If its not working, than the issue may be because of value mis-match of image and mapImage required value.

Let me know if any other details are required.

Accept & up-vote the answer if it helps.

happy splunking.....!!!!!!

0 Karma

Muwafi
Path Finder

Hi @gaurav_maniar

Actually it's my bad after I had a big cup of coffee 😄 and reviewing my search query again I found the token was defined in a sub-search , so in the results it will come to the second row or the third in the table - depending on the order of the sub-search. so in that case token was getting null.

I have modified the token definition to be in the main search and it's working fine now,

Thanks for your reply my friend.

Happy Splunking to you too 😉

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!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...