Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
frankh opened this issue Aug 6, 2024 · 2 comments · May be fixed by #21028
Open

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

frankh opened this issue Aug 6, 2024 · 2 comments · May be fixed by #21028
Labels
source: http_server Anything `http_server` source related type: feature A value-adding code addition that introduce new functionality.

Comments

@frankh
Copy link
Contributor

frankh commented Aug 6, 2024

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 frankh added the type: feature A value-adding code addition that introduce new functionality. label Aug 6, 2024
@jszwedko
Copy link
Member

jszwedko commented Aug 6, 2024

Related #20395

@jszwedko jszwedko added the source: http_server Anything `http_server` source related label Aug 6, 2024
@frankh
Copy link
Contributor Author

frankh commented Aug 8, 2024

had a crack at implementing this: #21028

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
source: http_server Anything `http_server` source related type: feature A value-adding code addition that introduce new functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants