Dashboards & Visualizations

Error in Splunk dashboard while loading

uagraw01
Builder

Hello Splunkers!!

I am getting below message populating while loading Splunk dashboard as I am using one javascript and css in the dashboard. Please help to fix this error so I will completely disappear.

Error while loading Splunk dashboard.

uagraw01_0-1722698631596.png


Error showing in developer console.

uagraw01_1-1722698654697.png

 

Labels (2)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

Can you post your javascript?

0 Karma

uagraw01
Builder
require(["jquery", "splunkjs/mvc", "splunkjs/mvc/simplexml/ready!"], function($, mvc) {
  
    // Properties
    var earliest = 0;
    var latest = 0;
  
    // Update Lead Time to the correct format
    function setFormatLeadTime() {
        $("#lead_time svg text").each(function() {
            if(!$(this).text().match(":")) {
                $(this).text(secondsTimeSpanToDHM($(this).text()));
            }
        });
    }
    
    // Open a URL in a new window
    function setUrl(url) {
        window.open(url, "_blank");
        return false;
    }
  
    // Default Token Components
    var tokens = mvc.Components.get("default");
    
    // Set On-Click listeners
    $("#throughput .splunk-chart").click(function(){ setUrl("/app/customer_reports/throughput_report_-_0136_system?form.time.earliest="+earliest+"&form.time.latest="+latest+"") });
    $("#availability .splunk-chart").click(function(){ setUrl("/app/customer_reports/availability_report?form.time.earliest="+earliest+"&form.time.latest="+latest+"") });
    $("#completeness .splunk-chart").click(function(){ setUrl("/app/customer_reports/completeness_order?form.time.earliest="+earliest+"&form.time.latest="+latest+"") });
    $("#on_time .splunk-chart").click(function(){ setUrl ("/app/customer_reports/on-time_performance_report_customer?form.time.earliest="+earliest+"&form.time.latest="+latest+"") });
    $("#utilization .splunk-chart").click(function(){ setUrl("/app/customer_reports/load_forming_logic?form.time.earliest="+earliest+"&form.time.latest="+latest+"") });
    $("#partitioning .splunk-chart").click(function(){ setUrl("/app/customer_reports/load_forming_logic?form.time.earliest="+earliest+"&form.time.latest="+latest+"") });
    $("#group_coherence .splunk-chart").click(function(){ setUrl("/app/customer_reports/load_forming_logic?form.time.earliest="+earliest+"&form.time.latest="+latest+"") });
    $("#lead_time .splunk-chart").click(function(){ setUrl("/app/customer_reports/lead_time_report?form.time.earliest="+earliest+"&form.time.latest="+latest+"") });
    $("#productivity .splunk-chart").click(function(){ setUrl("/app/customer_reports/productivity_total?form.time.earliest="+earliest+"&form.time.latest="+latest+"") });
    
    // Set Token listener for Lead Time
    tokens.on("change:lead_time", function(model, value, options) {
        setTimeout(function() { setFormatLeadTime() }, 500);
        setTimeout(function() { setFormatLeadTime() }, 1500);
    });
    
    // Set Token listener for earliest_epoch
    tokens.on("change:time.earliest_epoch", function(model, value, options) {
        earliest = value;
    }); 
    
    // Set Token listener for latest_epoch
    tokens.on("change:time.latest_epoch", function(model, value, options) {
        latest = value;
    }); 

    // Attribute listener for date time picker 
    $("#time div[data-test='time-range-dropdown'] button").attrchange({
        trackValues: true, /* Default to false, if set to true the event object is updated with old and new value.*/
        callback: function (event) { 
            //event               - event object
            //event.attributeName - Name of the attribute modified
            //event.oldValue      - Previous value of the modified attribute
            //event.newValue      - New value of the modified attribute
            //Triggered when the selected elements attribute is added/updated/removed
            if (event.attributeName == "aria-expanded" && event.newValue == "true") {
                $("div[data-test-panel-id='date'] > button[data-test='toggle']").click();
                $("div[data-test='range-type'] button").attrchange({
                    trackValues: true,
                    callback: function (event) { 
                        $("button[data-test-value='since']").click()
                    }
                });
                $("div[data-test-value='between'] > button[data-test='toggle']").click(); 
            }
        }
    });

});

 

@bowesmana Please check the above pasted script.

0 Karma

bowesmana
SplunkTrust
SplunkTrust

Have you looked at the chromestatus URL - that tells you the events were deprecated in July 2024 - you can re-enable them, but you may want to look at your script against that explanation.

 

uagraw01
Builder

@bowesmana Could you help me to understand what does it actually mean ?

0 Karma

bowesmana
SplunkTrust
SplunkTrust

Unfortunately not - I don't understand it myself

0 Karma
Get Updates on the Splunk Community!

How to Get Started with Splunk Data Management Pipeline Builders (Edge Processor & ...

If you want to gain full control over your growing data volumes, check out Splunk’s Data Management pipeline ...

Out of the Box to Up And Running - Streamlined Observability for Your Cloud ...

  Tech Talk Streamlined Observability for Your Cloud Environment Register    Out of the Box to Up And Running ...

Splunk Smartness with Brandon Sternfield | Episode 3

Hello and welcome to another episode of "Splunk Smartness," the interview series where we explore the power of ...