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
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 ...