Dashboards & Visualizations

Token set for Map Marker in dashboard studio

Srubhi
Path Finder
I need to set a token on the green marker displayed on the map. The search includes the fields REGION, latitude, longitude, and status. Whenever a user clicks on a marker, the corresponding token should be set, and any panel that uses this token should become visible.
 

 Below is my source code,

{
  "type": "splunk.map",
  "title": "Active Alert in Map View",
  "dataSources": {
    "primary": "ds AFMPLT"
  },
  "options": {
    "layers": [
      {
        "type": "marker",
        "data": "primary",
        "latitude": "> primary | seriesByName('latitude')",
        "longitude": "> primary | seriesByName('longitude')",
        "size": 12,
        "fields": {
          "REGION": "> primary | seriesByName('REGION')",
          "STATUS": "> primary | seriesByName('status')"
        },
        "dataColors": "> primary | seriesByName('status') | matchValue(colorMatchConfig)",
        "additionalTooltips": [
          "REGION",
          "STATUS"
        ],
        "resultLimit": 1000
      }
    ],
    "center": [
      47.31597438587,
      19.366742195838
    ],
    "zoom": 1.53,
    "showZoomControls": false,
    "showScale": false
  },
  "context": {
    "colorMatchConfig": [
      {
        "match": "Healthy",
        "value": "#00FF00"
      },
      {
        "match": "Critical",
        "value": "#FF0000"
      },
      {
        "match": "No Data",
        "value": "#808080"
      }
    ]
  },
  "eventHandlers": [
    {
      "type": "drilldown.setToken",
      "options": {
        "tokens": [
          {
            "token": "REGION",
            "key": "row.REGION"
          }
        ]
      }
    }
  ],
  "containerOptions": {},
  "showProgressBar": false,
  "showLastUpdated": false
}
Labels (2)
0 Karma

kknairr
Contributor

@Srubhi The correct syntax in Dashboard Studio drilldown event handlers is row.REGION.value. You must reference the .value property of the field in the row object. This ensures that when a user clicks on a marker, the actual value of the REGION field is assigned to the token.

So, in your JSON, the event handler should be modified as below:

......................

"eventHandlers": [
...........

"tokens": [
{
"token": "REGION",
"key": "row.REGION.value"
} ]

]

Ref: Setting tokens on a visualization click | Splunk Enterprise, Splunk Cloud Platform (last updated 202...

>>

If this post addressed your question, you can:

  • Give it karma to show appreciation 👍
  • Mark it as the solution if it solved your issue ✔️
  • Add a comment if you’d like more details ✏️

Acknowledging helpful answers keeps the community strong and motivates contributors to continue sharing their expertise.

>>

0 Karma

Srubhi
Path Finder

Srubhi_0-1776087796881.png

Hi @kknairr / i do have a value for REGION but it is returning as null when i click on the map marker could you please suggest here

0 Karma

livehybrid
SplunkTrust
SplunkTrust

Hi @Srubhi 

I think the syntax for the key is row.<fieldname>.value

therefore you need row.REGION.value not row.REGION

See https://help.splunk.com/en/splunk-cloud-platform/create-dashboards-and-reports/dashboard-studio/10.3...

🌟 Did this answer help you? If so, please consider:

    • Adding karma to show it was useful
    • Marking it as the solution if it resolved your issue
    • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing.

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!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...