diff --git a/src/main/java/org/opensearch/security/auditlog/impl/AbstractAuditLog.java b/src/main/java/org/opensearch/security/auditlog/impl/AbstractAuditLog.java index 558d86994c..6c4350c603 100644 --- a/src/main/java/org/opensearch/security/auditlog/impl/AbstractAuditLog.java +++ b/src/main/java/org/opensearch/security/auditlog/impl/AbstractAuditLog.java @@ -644,19 +644,17 @@ public void logDocumentWritten(ShardId shardId, GetResult originalResult, Index XContentType.JSON ) ) { - if (auditConfigFilter.shouldLogRequestBody()) { - Object base64 = parser.map().values().iterator().next(); - if (base64 instanceof String) { - msg.addSecurityConfigContentToRequestBody( - new String(BaseEncoding.base64().decode((String) base64), StandardCharsets.UTF_8), - id - ); - } else { - msg.addSecurityConfigTupleToRequestBody( - new Tuple(XContentType.JSON, currentIndex.source()), - id - ); - } + Object base64 = parser.map().values().iterator().next(); + if (base64 instanceof String) { + msg.addSecurityConfigContentToRequestBody( + new String(BaseEncoding.base64().decode((String) base64), StandardCharsets.UTF_8), + id + ); + } else { + msg.addSecurityConfigTupleToRequestBody( + new Tuple(XContentType.JSON, currentIndex.source()), + id + ); } } catch (Exception e) { log.error(e.toString()); @@ -671,9 +669,7 @@ public void logDocumentWritten(ShardId shardId, GetResult originalResult, Index // originalResult.internalSourceRef())); // current source, normally not null or empty - if (auditConfigFilter.shouldLogRequestBody()) { - msg.addTupleToRequestBody(new Tuple(XContentType.JSON, currentIndex.source())); - } + msg.addTupleToRequestBody(new Tuple(XContentType.JSON, currentIndex.source())); } }