List all Devices That Haven't Reported for More Than 7 Days and Limit Result Fields

List all Devices That Haven't Reported for More Than 7 Days and Limit Result Fields

Back to CloudGen Access CLI Client Usage Examples

./access-cli devices list -list-all -o json | jq '(now-3600*24*7) as $when | .[] | select(.last_report_at != null) | select(.last_report_at | sub(".[0-9]*Z$"; "Z")| strptime("%Y%m-%dT%H:%M:%SZ") | mktime < $when) | {User: .user.name, DeviceCreated: .created_at, Model: .hardware_model, LastReport: .last_report_at}'

Example output:

 

{ "User": "Carol", "DeviceCreated": "2022-04-08T13:07:26.985Z", "Model": "MacBookAir10,1", "LastReport": "2022-06-02T18:27:43.000Z" } { "User": "Bob", "DeviceCreated": "2022-06-08T03:52:28.016Z", "Model": "iPhone12,8", "LastReport": "2022-06-08T03:55:47.000Z" } { "User": "Alice", "DeviceCreated": "2022-05-26T18:21:44.543Z", "Model": "MacBookPro15,2", "LastReport": "2022-06-02T16:14:04.000Z" } { "User": "Bob", "DeviceCreated": "2022-05-19T05:37:39.850Z", "Model": "Latitude 7420", "LastReport": "2022-06-08T07:12:23.000Z" }

 

 

 


We value your feedback.
If you have questions, suggestions, or feedback on our documentation, contact the Campus Product Documentation team.
For general product inquiries or technical support, please contact the global Barracuda Support team.