Skip to main content

Data Auditing

This guide takes you through the extensive auditing within OpenDataDSL and how you can utilise it to monitor what has changed in the system and track changes over time

Introduction

Audit records are created for every action performed by users on the data stored in OpenDataDSL.

Information Recorded

Audit Record

An audit record contains the following information:

NameDescriptionType
_idUnique identifierObjectID
actionThe action performedString
serviceThe name of the serviceString
sourceThe source of the dataString
userThe user id who performed the actionString
invocationIdThe request id for the actionString
descriptionA description or reason for the changeString
keyThe ID of the entity affected by the actionString
versionThe version number of the affected entityNumber
refA link to the entity affected by the actionReference
statusThe HTTP status of the actionNumber
timestampThe timestamp of when this action occurredDatetime
changesThe actual changes that were madeChanges Object

Changes Record

The changes information in the audit record contains the following information:

NameDescriptionType
kindThe type of changeString - N=New, E=Edited, D=Deleted
lhsThe old valueAny
rhsThe new valueAny
pathThe path to the changed value in the entityString array

Example Audit Record

The following example audit record is the recorded information after the name property in an object called AUDIT01 is changed from 'Audit Test' to 'Audit Testing'

{
"_id": "650abb58baa8e12c386fccb2",
"action": "update",
"changes": [
{
"kind": "E",
"lhs": "Audit Test",
"path": [
"name"
],
"rhs": "Audit Testing"
}
],
"invocationId": "aeca52ba-3c7b-47e8-94b3-813cdec26dd1",
"key": "AUDIT01",
"ref": {
"_type": "VarReference",
"_service": "object",
"_oid": "AUDIT01"
},
"service": "object",
"source": "private",
"status": 200,
"timestamp": "2023-09-20T09:28:56.559",
"user": "user@example.com",
"version": 0
}