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
Get Updates on the Splunk Community!

What's New in Splunk Enterprise 9.4: Features to Power Your Digital Resilience

Hey Splunky People! We are excited to share the latest updates in Splunk Enterprise 9.4. In this release we ...

Take Your Breath Away with Splunk Risk-Based Alerting (RBA)

WATCH NOW!The Splunk Guide to Risk-Based Alerting is here to empower your SOC like never before. Join Haylee ...

SignalFlow: What? Why? How?

What is SignalFlow? Splunk Observability Cloud’s analytics engine, SignalFlow, opens up a world of in-depth ...