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!

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...