All Apps and Add-ons

How to make white space in Network Diagram viz unclickable ?

rohit_d
Engager

Hi, I have made Splunk Dashboard using Network Diagram viz (below snip). Requirement was to click on nodes so that it redirect to another URL or dashboard, which I have achieved using : Drilldown -> Link to Custom url -> https://xyz.splunkcloud.com/en-US/app/$row.value|n$

Issue is if i am clicking on white space in network diagram it is also taking me to another url which should not happen. I only need nodes in diagram to be clickable not white space. Any insight into this will be very helpful.
spl: 

 

| makeresults count=12
| streamstats count as id 
| eval from=case(id=1,"Machine1", id=2,"Machine2", id=3,"Load Balancer", id=4,"Machine3", id=5,"Machine4", id=6,"Web Server", id=7,"User", id=8,"Database")
| eval to=case(id=1,"Load Balancer",id=2,"Load Balancer",id=3,"Web Server",id=4,"Load Balancer",id=5,"Load Balancer",id=6,"Database",id=7,"Database") 
| eval value=case(id=1,"HEALTHY",id=2,"HEALTHY",id=3,"WARNING",id=4,"WARNING",id=5,"UNHEALTHY",id=6,"WARNING",id=7,"HEALTHY",1=1,"No Data")
| eval color=case(value=="HEALTHY","green",value=="WARNING","yellow",value=="HIGH","orange",value=="UNHEALTHY","red",value=="No Data","grey")
| eval value=case(id=1,"machine1_dashboard",id=2,"machine2_dashboard",id=3,"load_balancer_dashboard")
| fields from, to, value, color

 

Thanks.
network_diagram.PNG

Labels (1)
0 Karma
1 Solution

kamlesh_vaghela
SplunkTrust
SplunkTrust

@rohit_d 

It's look like is bug in Network Viz app. You can fix it by doing below change.

Open network-diagram-viz/appserver/static/visualizations/network-diagram-viz/visualization.js file.

Search for "_proto.handle_doubleclick_events"

Add below Patch code.

_proto.handle_doubleclick_events = function handle_doubleclick_events(obj) {
    if (this.parent_viz == null) {
        return;
    }
/* Patch Addded */
    if (obj.edges.length == 0) {
        return;
    }
/* Patch End */

.
.
.
.

 

Save it.

Bump the JS version.

https://localhost:8000/en-US/_bump

Run the dashboard and check drilldown.

Enjoy

🙂

KV

View solution in original post

kamlesh_vaghela
SplunkTrust
SplunkTrust

@rohit_d 

Can you please try this?

<drilldown>
          <condition match="$row.value$!=&quot;&quot;">
            <!-- Provide custom link  !-->
          </condition>
          <condition>
            <!-- Put it blank !-->
          </condition>
        </drilldown>

 

KV

rohit_d
Engager

Thanks for your reply. It partially resolved my issue.
If i refresh dashboard and click on white space, nothing is happening (which is good).
But when i click on any node to open another url/dashboard it opens fine and after that if i click on white space again it is taking me to same url which i clicked before.
It seems like when i click on node, url link is getting stored in $row.value$ and after that if i click anywhere in dashboard it is again taking me to same link.

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@rohit_d 

It's look like is bug in Network Viz app. You can fix it by doing below change.

Open network-diagram-viz/appserver/static/visualizations/network-diagram-viz/visualization.js file.

Search for "_proto.handle_doubleclick_events"

Add below Patch code.

_proto.handle_doubleclick_events = function handle_doubleclick_events(obj) {
    if (this.parent_viz == null) {
        return;
    }
/* Patch Addded */
    if (obj.edges.length == 0) {
        return;
    }
/* Patch End */

.
.
.
.

 

Save it.

Bump the JS version.

https://localhost:8000/en-US/_bump

Run the dashboard and check drilldown.

Enjoy

🙂

KV

Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...