-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Today console-log-json pulls object properties passed as args to the top level.
Example:
console.log('Hello', {a: 1}, {a: 2}, {a: 3}, 'World', {a: 4});
results to
{"level":"info","message":"Hello - World","___a":4,"__a":3,"_a":2,"a":1,"@timestamp":"2023-06-28T22:40:29.491Z"}
The behavior I suggest:
- Add a configuration option: CONSOLE_LOG_TOP_LEVEL_PROPERTIES_FIELD = 'topLevelPropsFieldName'
- When this option is set for the input above produce the following output:
{"level":"info","message":"Hello [0], [1], [2] World [3]", "[0]":{"a":1}, "[1]":{"a":2}, "[2]":{"a":3}, "[3]":{"a":4}, "@timestamp":"2023-06-28T22:40:29.491Z"}
and use only properties from the {"topLevelPropsFieldName": {...}}
to populate the top level.
Why this is needed:
Without this manual and explicit control 'random' properties go to the top level and this may affect other tools (like DataDog filters)
hiro5id
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request