Audit Logs

Attention: SAP Field Service Management documentation is now available at the SAP Help Portal. On 31 December 2020, docs.coresystems will no longer be available. Until that time, documentation will NOT be updated in docs.coresystems.

Intro

The Audit Logs screen in Admin enables users with sufficient rights to view all object changes that have occcurred in all SAP Field Service Management applications.


Exceptions

Please note the following exceptions:

  • Single value fields are abbreviated to 128k characters. For example, a value contained in the audit logs would be: “This is a very large Str…”
  • Records with more than 10M characters will be discarded.
  • Excluded fields (including binary, passwords, etc) will contain [Unaudited value]

Excluded Binary Fields

Please note that the following binary fields are excluded from auditing:

  • Signature
  • CompanyInfo#companyLogo
  • ChecklistTemplate#content
  • ChecklistInstance#content

Access

Access to the Audit Logs screen is restricted to users with the SUPERUSER role.


To access the Audit Logs screen, navigate to Admin > Account > Audit Logs.

Additionally, the Changelog screen can also be accessed by selecting the Changelog button below a Data Subject record in the Data Subjects screen:


A Closer Look

When you select a record in Audit Logs, the application will display the following:

Field Description
ID The ID of the Changelog entry.
Company If applicable, the company with which the object is associated.
Object ID The unique ID of the object.
Object Name The name of the object (example: Business Partner, User, Service Call).
Operation The CRUD operation which was performed on the object (example: Create, Update, Delete).
Occurred On The date/time at which the object was changed.
User The ID of the user responsible for performing the change.

By clicking on the link contained in the ID field, the application will then display the following:

By clicking on the icon in the Details field, the application will then display the following information.

Field Description
Field Name The name of the field on which the change occurred.
Old Value The previous field value of the object.
New Value The new field value of the object.

Cloud Audit Service

This service provides a REST API to query for audit logs that were produced in master and data apps.

Authentication

All requests to the API must be properly authenticated to perform a query. This basically means that the HTTP requests must have the headers Authorization, X-Client-ID and X-Client-Version.

For example:

  • Authorization: bearer 9e76c2ef-8356-4782-ba8d-d93681af456b
  • X-Client-ID: admin
  • X-Client-Version: 1.1

Authorization

Authorization also happens at every request to the API. The bearer token must be associated to the account and companies present in the query. Also the user associated to the token must have SUPERUSER role.

REST API

Base URL

https://[cluster].coresystems.net/cloud-audit-service/

Endpoints

At the moment is possible to query for a list of audit logs that belongs to an account and its companies but also to query for a single audit log by its ID.

[GET] /api/audit/v1/account/{accountId}/logs

Path parameters:

  • accountId : Long ( required )

Query parameters:

  • companyIds : List< Long >(optional, comma-separated values, -1 for all companies in the account)
  • userId : String (optional)
  • clientId : String (optional)
  • clientVersion : String (optional)
  • traceId : Long (optional)
  • objectId : List< String >(optional, comma-separated key:pair values)
  • objectName : String (optional)
  • operation : String (optional, values = create update delete)
  • fromDate : String (optional, format = yyyy-MM-dd'T'HH:mm:ss.SSSXXX)
  • toDate : String (optional, format = yyyy-MM-dd'T'HH:mm:ss.SSSXXX)
  • page : Integer (optional, default = 0, min = 0)
  • pageSize : Integer (optional, default = 10, min = 0, max = 250)

Example:

/api/audit/v1/account/83317/logs?companyIds=935031&objectName=User&objectId=id:230473&operation=update&fromDate=2019-09-20T14:26:20.639785Z

Response

{
    "content":[
        {
            "_index":"audit-logs-7-2019.09.25",
            "_type":"_doc",
            "_id":"audit-logs-7-2019.09.25+0+13",
            "_score":null,
            "_source":{
                "traceId":"918ccebc255c48b4934166bf07f9f147",
                "accountId":83317,
                "companyId":935031,
                "clientId":"admin",
                "data":{
                    "schema":null,
                    "database":null,
                    "objectName":"User",
                    "time":"2019-09-25T08:51:25.795Z",
                    "fields":[
                        {
                            "name":"lastChanged",
                            "oldValue":"2019-09-25 08:50:33.33",
                            "value":"2019-09-25 08:51:25.78"
                        },
                        {
                            "name":"passwordLastChanged",
                            "oldValue":null,
                            "value":"Wed Sep 25 08:51:25 UTC 2019"
                        }
                    ],
                    "operation":"update",
                    "objectId":[
                        {
                            "name":"id",
                            "value":"230473"
                        }
                    ]
                },
                "accountName":"customer",
                "companyName":null,
                "eventType":"audit-logs",
                "userName":"superuser",
                "clientVersion":"11.0.0",
                "userId":230473,
                "occurredOn":"2019-09-25T08:51:25.795Z"
            },
            "sort":[
                1569401485795,
                "User"
            ]
        },
        {
            "_index":"audit-logs-7-2019.09.24",
            "_type":"_doc",
            "_id":"audit-logs-7-2019.09.24+0+5",
            "_score":null,
            "_source":{
                "traceId":"bd5271c1d99d41a5a1316addf60a0e40",
                "accountId":83317,
                "companyId":935031,
                "clientId":"admin",
                "data":{
                    "schema":null,
                    "database":null,
                    "objectName":"User",
                    "time":"2019-09-24T12:29:46.655Z",
                    "fields":[
                        {
                            "name":"firstName",
                            "oldValue":"ast",
                            "value":"s"
                        }
                    ],
                    "operation":"update",
                    "objectId":[
                        {
                            "name":"id",
                            "value":"230473"
                        }
                    ]
                },
                "accountName":"customer",
                "companyName":null,
                "eventType":"audit-logs",
                "userName":"superuser",
                "clientVersion":"11.0.0",
                "userId":230473,
                "occurredOn":"2019-09-24T12:29:46.653Z"
            },
            "sort":[
                1569328186655,
                "User"
            ]
        }
    ],
    "pageable":{
        "sort":{
            "sorted":false,
            "unsorted":true,
            "empty":true
        },
        "offset":0,
        "pageSize":10,
        "pageNumber":0,
        "paged":true,
        "unpaged":false
    },
    "last":true,
    "totalPages":1,
    "totalElements":2,
    "size":10,
    "number":0,
    "numberOfElements":2,
    "first":true,
    "sort":{
        "sorted":false,
        "unsorted":true,
        "empty":true
    },
    "empty":false
}

[GET] /api/audit/v1/account/{accountId}/logs/{auditLogId}

Path parameters:

• accountId : Long (required) • accountId : Long (required) • auditLogId : String (required)

Query parameters:

• none

Example:

/api/audit/v1/account/83317/logs/audit-logs-7-2019.09.25+0+12

Response

{
    "_index":"audit-logs-7-2019.09.25",
    "_type":"_doc",
    "_id":"audit-logs-7-2019.09.25+0+12",
    "_score":1.0,
    "_source":{
        "traceId":"4f1c3404c069478e89a58af298205148",
        "accountId":83317,
        "companyId":935031,
        "clientId":"admin",
        "data":{
            "schema":null,
            "database":null,
            "objectName":"User",
            "time":"2019-09-25T08:50:33.332Z",
            "fields":[
                {
                    "name":"firstName",
                    "oldValue":"John",
                    "value":"John Jr."
                }
            ],
            "operation":"update",
            "objectId":[
                {
                    "name":"id",
                    "value":"230473"
                }
            ]
        },
        "accountName":"customer",
        "companyName":null,
        "eventType":"audit-logs",
        "userName":"superuser",
        "clientVersion":"11.0.0",
        "userId":230473,
        "occurredOn":"2019-09-25T08:50:33.332Z"
    }
}