Replies: 1 comment
-
|
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.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Question
Hello 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:
.a = "1"send:
curl.exe -X POST -H "Content-Type: application/x-ndjson" --data-binary "@data.ndjson" http://127.0.0.1:8090data.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 Config
Vector Logs
No response
Beta Was this translation helpful? Give feedback.
All reactions