vy commented on issue #4166:
URL: 
https://github.com/apache/logging-log4j2/issues/4166#issuecomment-5159901113

   Can we also discuss the new JTL grammar? This is the current complete MDC 
grammar of JTL: 
   
   ```
   config        = singleAccess | multiAccess
   
   singleAccess  = key , [ stringified ]
   key           = "key" -> string
   stringified   = "stringified" -> boolean
   
   multiAccess   = [ pattern ] , [ replacement ] , [ flatten ] , [ stringified ]
   pattern       = "pattern" -> string
   replacement   = "replacement" -> string
   flatten       = "flatten" -> ( boolean | flattenConfig )
   flattenConfig = [ flattenPrefix ]
   flattenPrefix = "prefix" -> string
   ```
   
   I'm not inclined to use `keyExcludes`, since it doesn't match the style used 
for the `pattern` directive. What do you think of the following grammar 
extension instead?
   
   ```
   literal = [ literalAllowed ], [ literalDisallowed]
   literalAllowed = "allowed" -> array of strings
   literalDisallowed = "disallowed" -> array of strings
   ```
   
   Example usage:
   
   ```
   {
     "$resolver": "mdc",
     "pattern": "user:(role|rank)",
     "replacement": "$1",
     "literal": {
       "allowed": [ "foo", "bar", "baz" ],
       "disallowed": [ "do", "re", "mi" ]
     }
   }
   ```
   
   Example usage for the case at hand:
   
   ```
   {
     "$resolver": "mdc",
     "flatten": true,
     "literal": {
       "disallowed" -> [ "@timestamp", "message", "log.logger" ]
     }
   }
   ```
   
   @ramanathan1504, @ppkarwasz, WDYT?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to