Repository navigation
|
To monitor Vector instances I want to ship internal logs. The event can have different fields from event to event. For example {
"error": "\"function call error for \\\"parse_json\\\" at (4:34): function call error for \\\"string\\\" at (16:33): expected string, got null\"",
"error_type": "conversion_failed",
"internal_log_rate_limit": true,
"message": "Mapping failed with event.",
"metadata": {
"kind": "event",
"level": "ERROR",
"module_path": "vector::internal_events::remap",
"target": "vector::internal_events::remap"
},
"stage": "processing",
"timestamp": "2024-08-29T14:40:27.919533Z",
"vector": {
"component_id": "transform_opensearch",
"component_kind": "transform",
"component_type": "remap"
}
}compared to {
"arch": "x86_64",
"debug": "false",
"message": "Vector has started.",
"metadata": {
"kind": "event",
"level": "INFO",
"module_path": "vector::internal_events::process",
"target": "vector"
},
"revision": "a9392b0 2024-08-26 14:35:19.223750502",
"timestamp": "2024-08-29T14:45:50.259364Z",
"version": "0.40.1"
}Could you please provide configuration to transform this to readable log messages like the ones printed in the console? The documentation is incomplete and does not describe all the possible fields and combinations. |
Replies: 2 comments 1 reply
|
I think you could hack something together with a I think you would need to do some conditional checks to see what format to use. For example:
I think the two examples you found are representative of the two types of events Vector emits: some are component-level and others are topology-level (and thus won't have component level metadata). |
|
This handles both examples and writes a console-style line to The component prefix is included when Try it in the VRL playground. Use |
This handles both examples and writes a console-style line to
.message:The component prefix is included when
.vectorexists. Other fields are formatted as key-value pairs, while the original structured fields remain available on the event. The field order and …