Dashboards & Visualizations

How do I fix this error: A custom JavaScript error caused an issue loading your dashboard?

homieji16
Loves-to-Learn

I have added the following to my dashboard and I am still getting this error (A custom JavaScript error caused an issue loading your dashboard). What should be my next steps?

<dashboard version="1.1" script="myCustomJS.js">

or 

<form version="1.1" script="myCustomJS.js">

 

Manage dashboards that need jQuery updates - Splunk Documentation

Labels (1)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@homieji16 

Is it possible to share your Sample XML and JS file?

KV

0 Karma

homieji16
Loves-to-Learn

<dashboard version="1.1" script="myCustomJS.js">
<label>Overview</label>
<row>
<panel>
<title>Controls Available</title>
<table>
<search>
<query>| inputlookup cc_controls_lookup where splunk_use_case=true | fields control_number control_label view | sort view | rename control_number as "Control Number" control_label AS "Brief Description"</query>
<earliest>-24h@h</earliest>

@kamlesh_vaghela 
<latest>now</latest>
</search>
<option name="count">40</option>
<option name="drilldown">row</option>
<option name="refresh.display">progressbar</option>
<drilldown>
<link target="_blank">$row.view$</link>
</drilldown>
</table>
</panel>
</row>
</dashboard>

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@homieji16 

Your XML looks good to me. I tried it and working fine.

<dashboard version="1.1" script="myCustomJS.js">
  <label>Overview</label>
  <row>
    <panel>
      <title>Controls Available</title>
      <table>
        <search>
          <query>| makeresults | eval control_number="control_number",control_label="control_label" | rename control_number as "Control Number" control_label AS "Brief Description"</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="count">40</option>
        <option name="drilldown">row</option>
        <option name="refresh.display">progressbar</option>
        <drilldown>
          <link target="_blank">$row.view$</link>
        </drilldown>
      </table>
    </panel>
  </row>
</dashboard>

 

 

Screenshot 2022-10-21 at 10.25.44 PM.png

 

No errors in the console.

Is it possible to share JS file?

 

KV

0 Karma

homieji16
Loves-to-Learn

This is an application with multiple dashboards to it.  How do I share the JS file?

0 Karma

homieji16
Loves-to-Learn
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@homieji16 

QQ. 

Does this dashboard open from another dashboard OR any dynamic query string values? Loading error happens when any dynamic tokens which are used in any search are not properly set which makes the search invalid for execution during the initial loading of the dashboard.  

If you have the same scenario then try to debug those values with the actual practical use case. 

I faced a similar issue and resolved it by fixing such dynamic values. In my case, I'm opening dashboards from multiple dashboards by passing flags and IP addresses. 

I hope this will help you.

KV

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

How to find the worst searches in your Splunk environment and how to fix them

Everyone knows Splunk is a powerful platform for running searches and doing data analytics. Your ...

Share Your Feedback: On Admin Config Service (ACS)!

Help Us Build a Better Admin Config Service Experience (ACS)   We Want Your Feedback on Admin Config Service ...

Build the Future of Agentic AI: Join the Splunk Agentic Ops Hackathon

AI is changing how teams investigate incidents, detect threats, automate workflows, and build intelligent ...