Add literal Context Data (MDC) filtering to JSON Template Layout - #4186
Add literal Context Data (MDC) filtering to JSON Template Layout#4186ramanathan1504 wants to merge 12 commits into
Conversation
ppkarwasz
left a comment
There was a problem hiding this comment.
Hi @ramanathan1504,
Looks good to me, with two small comments:
…g in ReadOnlyStringMapResolver
|
@vy done — Two things your example didn't pin down: |
|
@ppkarwasz reworked to the A mis-shaped |
| "literal": { | ||
| "disallowed": [ | ||
| "@timestamp", | ||
| "message", | ||
| "log.logger", | ||
| "log.level", | ||
| "event.dataset", | ||
| "process.thread.name", | ||
| "process.thread.id", | ||
| "ecs.version" | ||
| ] | ||
| } |
There was a problem hiding this comment.
Code looks good, but the naming for the configuration option seems odd. What about filter or keyFilter? The word literal doesn't tell me much, what this could do.
{
"filter": {
"includes": [
"@timestamp",
...
]
}
}There was a problem hiding this comment.
I'd not use the word filter, it doesn't match what we already have: key and pattern, which both "filter".
@ramanathan1504, we had an internal conversation with @ppkarwasz, and agreed to overload key instead. That is, if key is of type string, use the existing behavior, if it is of type object, use the new semantics with allowed/disallowed. Would you mind updating the PR in that direction, please?
…pdate related documentation
Add
allowed/disallowedliteral key filters to JSON Template Layout's (Context Data) MDC and Map resolvers.Update
EcsLayout.jsonto prevent MDC entries from overwriting structural ECS fields.Fixes #4166.