vector icon indicating copy to clipboard operation
vector copied to clipboard

http sources should be able to customise the response sent back to clients

Open frankh opened this issue 1 year ago • 2 comments

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Use Cases

Currently the HTTP source can only send empty response bodies, only the response code is customisable

There are many cases where returning some kind of info to clients is useful (for example, we assign all received events a "uuid" and would like to return those to clients)

Attempted Solutions

there is almost no way at all currently to return information in a response

the only work around is to have an http server side-car which processes the event but that removes a lot of the simplicity of using vector

Proposal

I would like to add a configuration option, response_body_key which would read a given field from the first event received and return it to clients on ack

Because this would execute after the decoding step, with vrl decoding this would enable a huge number of use-cases here without too much complexity

References

No response

Version

0.40.0

frankh avatar Aug 06 '24 14:08 frankh

Related https://github.com/vectordotdev/vector/issues/20395

jszwedko avatar Aug 06 '24 15:08 jszwedko

had a crack at implementing this: #21028

frankh avatar Aug 08 '24 14:08 frankh

Hello all, just checking to see if there are any updates on this. Thanks!

tot19 avatar Apr 10 '25 09:04 tot19