All Apps and Add-ons

Dynamically edit node border color?

hoangtony
Explorer

Hi Everyone,

Is there a method to dynamically set the border color of nodes? I can do it for the node fill color using the color field when generating search results however there isn't an option for border.

Looking at the SimpleXML I can see it has an option flow_map_viz.flow_map_viz.node_broder_color which sets it for all and is fixed.

I'm trying to make use of the border color to indicate an issue with the host node whereas the fill is the service running on it and being able to dynamically do this would be great.

Thanks!

0 Karma
1 Solution

chrisyounger
SplunkTrust
SplunkTrust

Yeah unfortunatly there isn't a way to do this at the moment sorry. You could try put one node over the top of another and just change the size?

Actually probably a better way would be to enable "HTML in labels" in advanced settings, and then you can pass a small block of HTML formatted text, something like eval label = "<div style=\"border: 2px solid " + my_color_variable + "\">" + some node contents + "</div>"

This basically gives you infinite customizability but it is a bit ugly.

View solution in original post

dm1
Contributor

Hi @hoangtony 

Can you please share how you are dynamically able to set the border using node fill color using the color field when generating search results ?

If possible, it would be great if you could also share the SPL as well. thanks.

0 Karma

chrisyounger
SplunkTrust
SplunkTrust

Yeah unfortunatly there isn't a way to do this at the moment sorry. You could try put one node over the top of another and just change the size?

Actually probably a better way would be to enable "HTML in labels" in advanced settings, and then you can pass a small block of HTML formatted text, something like eval label = "<div style=\"border: 2px solid " + my_color_variable + "\">" + some node contents + "</div>"

This basically gives you infinite customizability but it is a bit ugly.

hoangtony
Explorer

Hi Chris,

Thanks for getting back so quickly. I tried this approach and I'm seeing a border around the label/text itself (the screen capture above) and not the node border (the screen capture below).

Btw love the add-on!

alt text

alt text

Edit: Actually I figured that it's a DIV so I can change the width and height to match. I'll have a play with this, thanks.

0 Karma

chrisyounger
SplunkTrust
SplunkTrust

Yeah by injecting your own HTML with CSS you can do anything you want

0 Karma

hoangtony
Explorer

Thanks Chris, works a treat. I've just stuck the labels into a macro to clean up the search a little.

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!

From Raw Data to Executive-Ready Stories, Faster

Build Data Stories for Every Audience  A dashboard is rarely just a dashboard. It might be the view an ...

Guided Onboarding with Auto-schema Is Now Generally Available

  We are excited to announce the General Availability of Guided Onboarding with Auto-Schematization ...

ATTENTION: We’re Moving! (AGAIN!)

The Splunk Community Slack is undergoing a system migration to keep our workspace secure and ...