Can http sink send single events #23832
-
QuestionWe are trying to use (or rather misuse) vector as a simple http proxy that redacts some fields with sensitive data from the json payload. The batch mechanism of vector however sends the events wrapped in an array, even with Can this be configured somehow to only send a single event? E.g. instead of sending [
{
<payload>
}
] just send {
<payload>
} Vector Configsources:
http_input:
type: http_server
address: 0.0.0.0:8686
decoding:
codec: json
transforms:
payload_modifier:
inputs:
- http_input
type: remap
file: ${VECTOR_CONFIG_DIR}/sanitize.vrl # Simple redaction of various fields
sinks:
http_output:
inputs:
- payload_modifier
type: http
uri: <grafana-url>
encoding:
codec: json Vector LogsNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Changing the framing method will change how the output in sent to the http server. Looking at the source code it looks like the array (AKA
|
Beta Was this translation helpful? Give feedback.
Changing the framing method will change how the output in sent to the http server. Looking at the source code it looks like the array (AKA
[
and]
) is only inserted into the payload if encoding is json, the framing ischaracter_delimited
and the delimiter is,
. Since you already set the batching to 1, you should be able to set theframing
tonewline_delimited
like so (this may cause other issues but I think it should be fine. I'm pretty sure that if events were batched you'd get a jsonl style request):