App Usage to CSV - anyone using this script?

chris_kemp
Contributor III

Hi all - I'm trying to find a way for some of our management team to pull useful app usage reports from the JSS. (In the past, I've done this manually & spent way too many hours massaging the data into an Excel report.) I just installed the appUsageToCSV.jsp script - this is almost what I need, except for one thing: the report does not return the relevant usage date.

I pulled a sample report, and I can see that the entries are descending - so I can look at the numbers, and when they go from, say, 1 minute to the next being 14 hours, then I know I'm looking at the next available report. Even this, though, does not account for unreported days - the report pulled log data from the last 30 days, but does not account for un-logged days (such as when the computer is off) so I ended up with 18 days reported usage. That's fine - but I had to go to the JSS to see which days were being reported.

So: does anyone know how to modify the script to pull the relevant usage date field? Javascript is really not my thing...I did figure out how to change the number of days being pulled, so I have reports for 7, 30, and 90 days - but I need help with this one. Thanks!

4 REPLIES 4

chris_kemp
Contributor III

FOUND IT! Worked with Sam Johnson from Customer Support, who tested it for me before I could - definitely a tip of the hat to him for his help!

The following excerpt is from Sam's email to me:

Hey Chris, You pretty much did all the work on this one already. Based on your email, I just made an assumption that the getLogDate function would get us what we need, so I plugged it in where the CSV was being generated. Here is what I changed on the file: OLD (lines 57-61):
entry+=","";
entry = appUsage.getDisplayForegroundTime();
entry=""";
entry ="
";
%><%=entry%><%
NEW (lines 57-64):
entry=","";
entry = appUsage.getDisplayForegroundTime();
entry=""";
entry+=","";
entry = appUsage.getLogDate();
entry=""";
entry +="
";
%><%=entry%><%

This change will add a column to the CSV output that will return the log date for each application's Foreground Time entry. Of course, this will need further manipulation to make a pretty report - but it does make the output a little more useable, IMHO. :-)

hpstec
New Contributor

Is there a place where this script is available? Or a "how to" guide on how to use it? This script sounds incredible.

mm2270
Legendary Contributor III

Its available in the old Resource Kit download, though it may also be available in one of the repositories here on JAMFNation as well.

https://jamfnation.jamfsoftware.com/viewProduct.html?id=227&view=info

VIZ-Jabellar
New Contributor

Hi,

I'm trying to use this script to create a report, but I'm not well versed in java and I'm wondering if anyone can help.

What I'm trying to do is, create a report to have a date range of 7, 30, 90 days of app usage on multiple computers, let say a report of how many users are actively using Adobe products within the last 90 days. then export it to .csv format.

Any help would be appreciated!

Thanks!