You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An edge case was discovered where malformed JSON was generated using the JsonTemplateLayout instrumentation module with a log message that contained an escaped double quote followed by a comma.
For example, this log line: LOGGER.info("info {}", "\"bar\",");
produces the following JSON (prior to local decorating):
Description
An edge case was discovered where malformed JSON was generated using the JsonTemplateLayout instrumentation module with a log message that contained an escaped double quote followed by a comma.
For example, this log line:
LOGGER.info("info {}", "\"bar\",");
produces the following JSON (prior to local decorating):
which is valid JSON.
With local decorating enabled, the instrumentation module injects the
NR-LINKING
metadata as follows:which is invalid JSON since we inject in between the escaped
\
and",
The code currently checks for
",
in order to get the index for metadata injection.https://github.com/newrelic/newrelic-java-agent/blob/3cd9554e59a6575522a862178f78e6ef022a5a17/instrumentation/apache-log4j-layout-template-json-2.14.0/src/main/java/com/nr/agent/instrumentation/log4j2/layout/template/json/AgentUtils.java
We need to check for an unescaped
"
followed by a,
and adjust the metadata addition appropriately.The text was updated successfully, but these errors were encountered: