Deployment Architecture

Total Downloads showing Highest Numbers and clientsSummary.js

luminadsouza13
Engager

Can you tell me the search query to find what has been downloaded ? Also i see few discrepencies with code .

Path for code : /apps/splunk/share/splunk/search_mrsparkle/exposed/js/views/deploymentserver/ClientsSummary.js

For phoneHome in 24 Hours — 24 hrs is calculated based on datenow functionality but if you see the code for TotalDownloads .. its directly calculated the code for 1 hr (3600 sec)- It does not use the functionality of datenow( did not mention which 24 hour) ? Is the data calculated correctly ? 

PhoneHome Now :
==================

var numSecondsIn24Hours = 24 * 60 * 60;
if( !Date.now) {
Date.now = function()

{return new Date().getTime();}

;
}
var epoch_time = parseInt(Date.now()/1000, 10) - numSecondsIn24Hours;
var phonedHomeClients = new ClientsCollection();
var that = this;
phonedHomeClients.fetch({
data:

{ minLatestPhonehomeTime: epoch_time, count: 1 }

,
success: function(clients, response){
var numClients = 0;
if (clients.length > 0)

{ numClients = clients.first().paging.get('total'); }

that.$('#numPhonedHomeClients').html(numClients);
that.$('#phonedHomeLabel').html(i18n.ungettext("Client", "Clients", numClients));
}
});

TotalDownloads :
==================

//Get number of downloads in the last hour
var recentDownloads = new RecentDownloadsCollection();
var numSecondsInOneHour = 3600;
recentDownloads.fetch({
data:

{ count: 1, maxAgeSecs: numSecondsInOneHour }

,
success: function(recentDownloads, response){
var numDownloads = "N/A";

if (recentDownloads.length > 0)

{ numDownloads = recentDownloads.first().entry.content.get('count'); that.$('#downloadsLabel').html(i18n.ungettext("Total download", "Total downloads", numDownloads)); }

that.$('#numDownloadsInLastHour').html(numDownloads);
}
});

Labels (3)
0 Karma
Get Updates on the Splunk Community!

Registration for Splunk University is Now Open!

Are you ready for an adventure in learning?   Brace yourselves because Splunk University is back, and it's ...

Splunkbase | Splunk Dashboard Examples App for SimpleXML End of Life

The Splunk Dashboard Examples App for SimpleXML will reach end of support on Dec 19, 2024, after which no new ...

Understanding Generative AI Techniques and Their Application in Cybersecurity

Watch On-Demand Artificial intelligence is the talk of the town nowadays, with industries of all kinds ...