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!

.conf25 Registration is OPEN!

Ready. Set. Splunk! Your favorite Splunk user event is back and better than ever. Get ready for more technical ...

Detecting Cross-Channel Fraud with Splunk

This article is the final installment in our three-part series exploring fraud detection techniques using ...

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...