Reporting last N computers based on bes property date

(imported topic written by jasonpap200291)

I have a need to report on the last N computers (lets say 25) sorted based on the date output of a specific bes property. So for example, a computer has a specific property (named lets say “Last Date & Time”) with value:

1/29/2010 15:46:35

There will be hundreds of these computers with different dates but I want to create a custom web report that shows the most recent 25 of them based on this date. I am close in theory but not in real-life.

My plan is to convert the date to a specific number of seconds in “POSIX time” and then compare to “now” and choose only the most recent 25 (lowest number of seconds). Problem is that it sounds resource intensive but I’ll cross that bridge when I get to it.

Here is what I have so far:

<?relevance trs of ( td of name of it & td of value of result ( it, bes property "IP Address" ) & td of value of result ( it, bes property "Domain/Workgroup" ) & td of value of result ( it, bes property "User Name" ) & td of value of result ( it, bes property "OS" ) & ) of bes computers whose (number of bes computers <= 25) ?>

Obviously the above doesn’t work, it only limits the number of computers visible to 25, doesn’t provide any real intelligence or filtering.

So I started changing it:

) of bes computers whose ((number of bes computers <= 25) whose “lowest number” of ((current date) as date) - ( bes property “Last Date & Time”) as date)

But I can’t find the proper inspector or relevance for “lowest number” (if thats the best way). Been plugging on http://support.bigfix.com/cgi-bin/inspectorsearch/inspector_search.cgi but not helping.

Another approach may be instead to convert the “Last Date & Time” to the number of seconds from 1970 “POSIX time” and then just choose the highest 25.

Any thoughts or direction appreciated.

-Jason

(imported comment written by jessewk)

Hi Jason.

The short answer is you cannot accomplish your goal strictly in relevance. We don’t have “ith” or range inspectors. Why? See my answer to your post here: http://forum.bigfix.com/viewtopic.php?id=3106

Your best bet is to pull the results into a javascript object and then use javascript to calculate the 25 most recent and display those. If you have the CPM sites, check out the source of the Top 25 Virus report in the main CPM site (the file is actually named “CPMTopTenVirusWebReport.beswrpt”). You’ll find all the code you need. It’s pretty well commented and it should be easy to adapt to your property.

Jesse

(imported comment written by jasonpap200291)

Thank you Jesse, I will take a look. I appreciate your time.

-Jason