-
QuestionHello everyone! I'm trying to enrich the incoming ndjson with tags and pass it on. If one of the ndjson lines contains broken json, the entire ndjson will not be passed on. How can I discard only the broken line? add_labels.vrl: send: data.ndjson (if I remove "broken," everything works): While writing this, I noticed that vector is adding its own "path," "source_type," and "timestamp" labels to the output. How can I avoid this? Thank you. Vector Configsources:
http_server_in:
type: http_server
address: 0.0.0.0:8090
decoding:
codec: "json"
framing:
method: "newline_delimited"
transforms:
add_labels:
inputs: [http_server_in]
type: remap
file: add_labels.vrl
sinks:
out:
inputs: ["add_labels"]
type: console
encoding:
codec: "json"
framing:
method: "newline_delimited"Vector LogsNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
I found this solution: Change "codec" for "source" to "bytes". sources:
http_server_in:
type: http_server
address: 0.0.0.0:8090
decoding:
codec: "bytes"
framing:
method: "newline_delimited"
transforms:
add_labels:
inputs: [http_server_in]
type: remap
file: add_labels.vrl
sinks:
out:
inputs: ["add_labels"]
type: console
encoding:
codec: "json"
framing:
method: "newline_delimited"In the vrl file: The output skips broken JSON lines and doesn't add extra tags: Is this the best solution? |
Beta Was this translation helpful? Give feedback.
I found this solution:
Change "codec" for "source" to "bytes".
In the vrl file:
The output skips broken JSON lines and doesn't add extra tags:
Is this the best solution?