|
1 | 1 | --- |
2 | 2 | id: migrate-audit-logging |
3 | | -title: Migrate Audit Logging |
| 3 | +title: Migrating Audit Logs from Role V1 to V2 |
4 | 4 | description: Learn to migrate from V1 to V2 audit logging by changing the search queries. |
5 | 5 | --- |
6 | 6 |
|
7 | 7 | <p><a href="/docs/beta"><span className="beta">Beta</span></a></p> |
8 | 8 |
|
9 | 9 | import useBaseUrl from '@docusaurus/useBaseUrl'; |
10 | 10 |
|
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. |
12 | 12 |
|
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. |
14 | 14 |
|
15 | 15 | :::note |
16 | | -V2 changes are only applicable for `RoleUpdate` and `RoleCreated` events. |
| 16 | +V2 changes are **only** applicable for `RoleUpdate` and `RoleCreated` events. |
17 | 17 | ::: |
18 | 18 |
|
19 | 19 | <br/><img src={useBaseUrl('img/users-roles/JSON-diff-V1-V2.png')} alt="JSON-diff-V1-V2" style={{border: '1px solid gray'}} width="800"/> |
20 | 20 |
|
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. |
22 | 22 |
|
23 | 23 | ```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 |
26 | 32 | ``` |
27 | 33 |
|
28 | 34 | ```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 |
31 | 45 | ``` |
0 commit comments