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!

Last Chance to Submit Your Paper For BSides Splunk - Deadline is August 12th!

Hello everyone! Don't wait to submit - The deadline is August 12th! We have truly missed the community so ...

Ready, Set, SOAR: How Utility Apps Can Up Level Your Playbooks!

 WATCH NOW Powering your capabilities has never been so easy with ready-made Splunk® SOAR Utility Apps. Parse ...

DevSecOps: Why You Should Care and How To Get Started

 WATCH NOW In this Tech Talk we will talk about what people mean by DevSecOps and deep dive into the different ...