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 "

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

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

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

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

Explorer

Thank you!

0 Karma
State of Splunk Careers

Access the Splunk Careers Report to see real data that shows how Splunk mastery increases your value and job satisfaction.

Find out what your skills are worth!