[
https://issues.apache.org/jira/browse/LOG4J2-3074?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Volkan Yazici resolved LOG4J2-3074.
-----------------------------------
Resolution: Fixed
> Add replacement parameter to mdc resolver
> -----------------------------------------
>
> Key: LOG4J2-3074
> URL: https://issues.apache.org/jira/browse/LOG4J2-3074
> Project: Log4j 2
> Issue Type: Improvement
> Components: JsonTemplateLayout
> Affects Versions: 2.14.1
> Reporter: Paul Rubin
> Priority: Minor
> Fix For: 2.15.0
>
>
> This story aims to add a {{replacement}} parameter to
> {{ReadOnlyStringMapResolver}} (which is used by {{ThreadContextDataResolver}}
> and {{MapResolver}}) for modifying the keys of the map before resolving them.
> That is, given the following JSON template
> {code:json}
> {
> "user": {
> "$resolver": "mdc",
> "pattern": "user:(.*)",
> "replacement": "$1"
> }
> }
> {code}
> A {{LogEvent}} with an MDC map composed of {{user:name}}, {{user:role}},
> {{sessionId}} entries will generate the following JSON:
> {code:json}
> {
> "user": {
> "name": "Paul Rubin",
> "role": "ADMIN"
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)