Data / Find audit logs
Task in alpha phase
This Data Factory task is in phase. You can contact the Product-Live team at contact@product-live.com if you want more details and get an early access.
This task allows to find audit logs. Audit logs track all changes made to your data, including who made the change, when, and what was modified.
Task name:
Examples
json
{
"name": "data-audit-log-find",
"taskReferenceName": "find_audit_logs",
"description": "Find all audit logs",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"findMode": "ALL",
"request": {
"method": "INLINE",
"contentType": "application/json",
"model": "default"
}
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
json
{
"name": "data-audit-log-find",
"taskReferenceName": "find_audit_logs",
"description": "Find audit logs for item creation",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"findMode": "REQUEST",
"request": {
"method": "INLINE",
"contentType": "application/json",
"model": "default",
"json": {
"criteria": {
"type": "eq",
"field": "type",
"value": "item.create"
}
}
}
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Definition
| Property | Type | Required | Description |
|---|---|---|---|
| The name (or type) of the task | |||
| The unique name of the task in your job. It is used to reference this task in the workflow. | |||
| The functional description of this task in your job. | |||
The type of the task. It must be SUB_WORKFLOW. | |||
| : | true: the job continues if there is an error on this task. false: the job fails. | ||
| Input parameters of the task. See below |
Inputs Parameters
| Property | Type | Required | Description |
|---|---|---|---|
| The Product-Live API key If not provided, an automaticaly generated API key will be used to perform the request on behalf of the current user. If provided, the given API key will be used to perform the request. | |||
ALL: Fetch all elements. REQUEST: Fetch all elements matching certain criteria. | |||
| See below | |||
To day, application/json and application/xml are supported. | |||
INLINE: The request body is provided inline in the request object. ATTACHMENT: The request body is provided as an attachment in the request object. | |||
If method == INLINE and contentType == application/json | The request body as a JSON object. | ||
The options of the request. Available options are: limit, sort, sortOrder. | |||
| The maximum number of elements to be returned by the task. If not set, the task returns the maximum number of elements available. If the limit property is less than the maximum number of elements that can be returned, the task returns the number of elements specified by the limit property. | |||
| The field to sort the elements by. | |||
The order to sort the elements by. Available orders are: ASC, DESC. | |||
| The criteria of the request. See examples below | |||
If request.method == ATTACHMENT | The request body as a file. | ||
Default: API. The model/format used in the request. To day, only 'API' is supported. | |||
Default: [{"mediaType": "application/json", "outputMode": "INLINE", "outputKey": "json"}]. | |||
The media type of the output. To day, application/json and application/xml are supported. | |||
INLINE: The output is provided inline in the output object. ATTACHMENT: The output is provided as an attachment in the output object. INLINE is only supported for mediaType=application/json | |||
| The key of the output. Either json or xml | |||
Default: DEFAULT. The model/format used in the output. To day, only 'DEFAULT' is supported. |
JSON criteria examples
json
{
"criteria": {
"type": "eq",
"field": "type",
"value": "item.create"
}
}1
2
3
4
5
6
7
2
3
4
5
6
7
XML criteria examples
xml
<?xml version="1.0" encoding="UTF-8"?>
<map xmlns="http://www.w3.org/2005/xpath-functions">
<map key="criteria">
<string key="field">type</string>
<string key="type">eq</string>
<string key="value">item.create</string>
</map>
</map>1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
Outputs
| Property | Type | Description |
|---|---|---|
| The total number of elements exported by the task | ||
An object containing the result of the task. Each output key is the key of the output defined in the outputs[].outputKey input parameter. |
Json output - outputs[].outputMode=INLINE and outputs[].mediaType=application/json
output.jsonis an array of objects as defined in the audit logs API.jsonis the default output key but may be changed by setting theoutputKeyproperty.
Example output:
json
[
{
"object": "audit_log",
"timeGenerated": "2024-05-17T14:30:00.000Z",
"entityType": "item",
"version": "3",
"details": {
"accountId": "1234",
"suggestionId": "56789",
"itemId": "80303",
"status": "SUCCESS",
"actionOrigin": "DATA_FACTORY",
"actionType": "APPLY_SUGGESTION",
"updatedFieldsKey": [
"EAN_13"
],
"updatedFields": [
{
"key": "EAN_13",
"type": "IDENTIFIER",
"value": {
"data": "3610011803438"
}
}
],
"triggeredBy": "USER",
"issuedAt": "2024-05-17T14:30:00.000Z",
"tableId": "1470",
"contextId": "2342",
"jobId": "65819ba43ad5b963658ab35d"
},
"type": "item.create"
}
]1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
XML output - outputs[].outputMode=ATTACHMENT and outputs[].mediaType=application/xml
Example output:
xml
<?xml version="1.0" encoding="UTF-8"?>
<array xmlns="http://www.w3.org/2005/xpath-functions">
<map>
<string key="object">audit_log</string>
<string key="timeGenerated">2024-05-17T14:30:00.000Z</string>
<string key="entityType">item</string>
<string key="version">3</string>
<map key="details">
<string key="accountId">1234</string>
<string key="suggestionId">56789</string>
<string key="itemId">80303</string>
<string key="status">SUCCESS</string>
<string key="actionOrigin">DATA_FACTORY</string>
<string key="actionType">APPLY_SUGGESTION</string>
<array key="updatedFieldsKey">
<string>EAN_13</string>
</array>
<array key="updatedFields">
<map>
<string key="key">EAN_13</string>
<string key="type">IDENTIFIER</string>
<map key="value">
<string key="data">3610011803438</string>
</map>
</map>
</array>
<string key="triggeredBy">USER</string>
<string key="issuedAt">2024-05-17T14:30:00.000Z</string>
<string key="tableId">1470</string>
<string key="contextId">2342</string>
<string key="jobId">65819ba43ad5b963658ab35d</string>
</map>
<string key="type">item.create</string>
</map>
</array>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Limits and additional notes
- When the
outputMode=INLINEis selected, the maximum number of elements returned by this task is limited to1000. If more elements are to be returned, the task ends with an error. To export up to the maximum of elements, use thelimitinput parameter to limit the number of elements return.
Additional examples
Find audit logs with API key
job.json
json
{
"name": "data-audit-log-find",
"taskReferenceName": "find_audit_logs",
"description": "Find audit logs using an API key",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"apiKey": "${workflow.input.apiKey}",
"findMode": "ALL",
"request": {
"method": "INLINE",
"contentType": "application/json",
"model": "default",
"json": {
"options": {
"limit": 100
}
}
}
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21