Dashboards & Visualizations

Why do we get warning while editing Simplexml with custom Javascripts? "Warning: Custom scripts included on this page may cause unexpected behavior. Learn more about custom scripts "

yelkey
Explorer

I have included some custom javascripts in simplexml for simple features such as highlighting a table row etc but when I try to edit the source, a warning is always displayed "Warning: Custom scripts included on this page may cause unexpected behavior. Learn more about custom scripts". Why do we get this warning? how reliable is including custom javascripts to a dashboard. Is there a chance that it might suddenly not work and impact the stability of the dashboard?

0 Karma
1 Solution

elliotproebstel
Champion

Including JavaScript in a SimpleXML dashboard is perfectly fine and stable, as long as the developer(s) who maintain the XML and the JS understand the interactions between the two. The warning is, as I understand it, meant to remind someone who is editing a SimpleXML dashboard that what they see in front of them is not the full scope of code that will execute - so editing a search in the XML, for example, may not have the effect they expect if they don't also edit a section of the JS that also acts on the search code. The JS and SimpleXML, if maintained in tandem with a full understanding of the behavior of both, should work just fine.

View solution in original post

elliotproebstel
Champion

Including JavaScript in a SimpleXML dashboard is perfectly fine and stable, as long as the developer(s) who maintain the XML and the JS understand the interactions between the two. The warning is, as I understand it, meant to remind someone who is editing a SimpleXML dashboard that what they see in front of them is not the full scope of code that will execute - so editing a search in the XML, for example, may not have the effect they expect if they don't also edit a section of the JS that also acts on the search code. The JS and SimpleXML, if maintained in tandem with a full understanding of the behavior of both, should work just fine.

nick405060
Motivator

It's an extremely poorly worded and unnecessary message. Really? You're going to make the message be "WARNING: Custom scripts included on this page may cause unexpected behavior", which makes you think there is a completely different and larger problem, than just "remember! you have js code!"?? Over the last 3000 hours of Splunk developing, I never once thought that the error message was just a simple "remember you have js code" reminder, and always thought there was some stability problem.

If you don't know how code works and the fact that code might call other code (wait really?), you should not be editing SimpleXML to begin with. At least word the message better.

0 Karma

yelkey
Explorer

Thank you!

0 Karma
Get Updates on the Splunk Community!

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

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...