Skip to content

Commit 9196078

Browse files
committed
examples and query added
1 parent 0615a55 commit 9196078

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed
Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,45 @@
11
---
22
id: migrate-audit-logging
3-
title: Migrate Audit Logging
3+
title: Migrating Audit Logs from Role V1 to V2
44
description: Learn to migrate from V1 to V2 audit logging by changing the search queries.
55
---
66

77
<p><a href="/docs/beta"><span className="beta">Beta</span></a></p>
88

99
import useBaseUrl from '@docusaurus/useBaseUrl';
1010

11-
This document outlines the migration process from V1 to V2 audit logging by modifying the search queries. The `filterPredicate` field in V1 audit logging is replaced with `logAlayticsFilter`, `auditDataFilter`, and `securityDataFilter` fields in V2. In addition, we have also added `selectionType` and `selectedViews` fields (what benefit with this?)
11+
With [RBAC for Indexes](/docs/manage/users-roles/roles/rbac-for-indexes/), role audit log lines will be changed and you are recommended to migrate the search from V1 to V2 audit logging. With advanced search filters added you can obtain more granular information about the selected role. The `filterPredicate` field in V1 audit logging is replaced with `logAnalyticsFilter`, `auditDataFilter`, and `securityDataFilter` fields in V2. In addition, we have also added `selectionType` and `selectedViews` fields to apply RBAC for indexes.
1212

13-
Currently, both the log lines of V1 and V2 will be accessible for RBAC indexes query.
13+
Currently, [Roles Management APIs v2](/docs/api/role-management-v2) records both the V1 and V2 log line changes.
1414

1515
:::note
16-
V2 changes are only applicable for `RoleUpdate` and `RoleCreated` events.
16+
V2 changes are **only** applicable for `RoleUpdate` and `RoleCreated` events.
1717
:::
1818

1919
<br/><img src={useBaseUrl('img/users-roles/JSON-diff-V1-V2.png')} alt="JSON-diff-V1-V2" style={{border: '1px solid gray'}} width="800"/>
2020

21-
For example, consider you are interested in searching a customer-specific query with a change in `roleupdated` or `rolecreated` events. Now, if you perform this search you will initially see the V1 type of event in the search results. However, to view the results with the V2 event type, you are required to adjust the parameters in the query.
21+
For example, consider you are interested in quering upon audit logs with change in `RoleUpdated` or `RoleCreated` events. Now, if you perform this search you will initially see the V1 type of event in the search results. However, to view the results with the V2 event type, you are required to adjust the parameters in the query.
2222

2323
```sql title="V1 Audit Logging"
24-
25-
24+
(_index=sumologic_audit_events)
25+
| json fields=_raw "roleIdentity.roleName" as role_name
26+
| json fields=_raw "eventTime"
27+
| json fields=_raw "role.filterPredicate" as create_role
28+
| json fields=_raw "to.filterPredicate" as update_role
29+
| json fields=_raw "operator.email" as actor
30+
| json fields=_raw "eventName" | where eventName matches "RoleCreated" OR eventName="RoleUpdate"
31+
| count by eventTime, eventName, actor, role_name, create_role, update_role
2632
```
2733

2834
```sql title="V2 Audit Logging"
29-
30-
35+
(_index=sumologic_audit_events)
36+
| json fields=_raw "roleIdentity.roleName" as role_name
37+
| json fields=_raw "eventTime"
38+
| json fields=_raw "role.logAnalyticsFilter" as created_log_analytics_filter
39+
| json fields=_raw "role.auditDataFilter" as created_audit_data_filter
40+
| json fields=_raw "to.logAnalyticsFilter" as updated_log_analytics_filter
41+
| json fields=_raw "to.auditDataFilter" as updated_audit_data_filter
42+
| json fields=_raw "operator.email" as actor
43+
| json fields=_raw "eventName" | where eventName matches "RoleCreatedV2" OR eventName="RoleUpdateV2"
44+
| count by eventTime, eventName, actor, role_name, created_log_analytics_filter, created_audit_data_filter, updated_log_analytics_filter, updated_log_analytics_filter
3145
```
-704 KB
Loading

0 commit comments

Comments
 (0)