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
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...