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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...