Description
When performing subdoc api operations, a subdoc mutation records multiple audit events for a single mutation - for example using code:
*Case 1 : Update using sub document API** |
public static void updateUsingSubDocApi() { |
String empDocumentId = "sample_1"; |
Duration duration = Duration.ofDays(2); |
List<MutateInSpec> specs = new ArrayList<>(); |
specs.add(MutateInSpec.replace("name", "update_2_name")); |
MutationResult mutateInResult = bucket.defaultCollection().mutateIn(empDocumentId, specs,
|
MutateInOptions.mutateInOptions().expiry(duration));
|
System.out.println(" data : " + mutateInResult); |
}
|
and then enabled audit logging for document modifications, we see that there is two entries in the audit log for a single subdoc mutation Then in audit.log, we see two entries with timestamps almost at the same time
{"bucket":"default","description":"Document was modified","id":20490,"key":"<ud>sample_1</ud>","local":{"ip":"172.17.0.2","port":11210},"name":"document modify","real_userid":{"domain":"local","user":"Administrator"},"remote":{"ip":"172.17.0.1","port":57948},"timestamp":"2021-05-10T18:25:42.601491Z"} |
{"bucket":"default","description":"Document was modified","id":20490,"key":"<ud>sample_1</ud>","local":{"ip":"172.17.0.2","port":11210},"name":"document modify","real_userid":{"domain":"local","user":"Administrator"},"remote":{"ip":"172.17.0.1","port":57948},"timestamp":"2021-05-10T18:25:42.601600Z"} |
Attachments
Issue Links
- backports to
-
MB-46477 [BP 6.6.3] Subdoc mutation operation log DOCUMENT_MODIFY audit event twice
- Closed