[
https://issues.apache.org/jira/browse/LOG4J2-3074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17376435#comment-17376435
]
Volkan Yazici commented on LOG4J2-3074:
---------------------------------------
[~paulrubin37], would you mind verifying that the added feature addresses your
case and if so, consequently close the ticket, please?
> 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)