Refining a REST query for audit logs

Product/components used and version/fix level:

Cumulocity IoT, v 1018

Detailed explanation of the problem:

I’m looking for help with syntax for a rest query. The query so far is (using Postman):
‘{{url}}/audit/auditRecords?withTotalPages=true&dateFrom=2024-09-25T20:40:00.000Z&dateTo=2024-09-25T23:00:00.000Z&pageSize=100&type=Operation’

That finds the audit records in the timeframe I want; from there I want to retrieve specific records.
One record I want to retrieve has this entry (I’ve masked some data to not post a prod URL):
'{
“activity”: “Operation created”,
“creationTime”: “2024-09-25T21:01:46.194Z”,
“source”: {
“self”: “https://t***.iot.***.com/inventory/managedObjects/9923485”,
“id”: “9923485”
},
“type”: “Operation”,
“self”: “https://t907.iot.bsci.com/audit/auditRecords/9923486”,
“id”: “9923486”,
“text”: “Operation created: status=‘PENDING’, description=‘Downloading software package with id 868355031’, device name=‘3300_004089’.”,
“time”: “2024-09-25T21:01:46.194Z”,
“user”: “device_3300_004089”,
“com_cumulocity_model_event_AuditSourceDevice”: {
“_id”: “35249”
}

I’d like to retrieve just records that have the description of downloading software or just audit records for the managed object. Is there any way to refine my query to retrieve that information? I’m not successful putting the JSON info in the query line.

Error messages / full error message screenshot / log file:

No error message

Question related to a free trial, or to a production (customer) instance?

Production instance.

Hi Dave,

you can find the API definition here:
https://www.cumulocity.com/api/core/#operation/getAuditRecordCollectionResource

searching for text in the description is not possible.

1 Like