Dashboards & Visualizations

SVG Custom visualization - drilldown or setting a token

tomaszwrona
Explorer

Hi all,

 

i have used the SVG Custom Visualisation to create a nice picture.

Now i would like to have a drilldown or at least a possibility to set a token, when a part of the picture is clicked on. Is there a way to achieve this? Any hint would be great.

 

Best regards

Tomasz

Labels (2)
0 Karma

tomaszwrona
Explorer

Hi all,

i did manage to answer my own question.

In order to use tokens in SVG Visualization following steps should be taken:

  1. Extend Simple XML Dashboard with Javascript
  2. Put an id on Splunk's default element, for example panel:
    <panel id="svgViz">
  3. Put an id on any SVG element you want to click on, for example g:
    <g id="myId" filter="url(#Shadow)">
  4. In Javascript get the panel:
    var my_panel = $("#svgViz");
  5. And then create onClick function to set myNewToken:
    my_panel.on("click", "#myId", function(e) {
      var default_tokens = mvc.Components.get("submitted");
      default_tokens.set("myNewToken", "value");
    });

 

Best regards

Tomasz

0 Karma
Get Updates on the Splunk Community!

Investigate Security and Threat Detection with VirusTotal and Splunk Integration

As security threats and their complexities surge, security analysts deal with increased challenges and ...

Observability Highlights | January 2023 Newsletter

 January 2023New Product Releases Splunk Network Explorer for Infrastructure MonitoringSplunk unveils Network ...

Security Highlights | January 2023 Newsletter

January 2023 Splunk Security Essentials (SSE) 3.7.0 ReleaseThe free Splunk Security Essentials (SSE) 3.7.0 app ...