Created
March 11, 2025 00:27
-
-
Save aramperes/0b84a1fc3ad1d89915e03187fdb13e5f to your computer and use it in GitHub Desktop.
Example Vector config to pipe HTTP JSON to AMQP, with a routing key
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example: curl http://localhost:8000 --data '{"nested": {"flowID": "world"}, "data": "hello"}' | |
sources: | |
in: | |
type: http_server | |
address: 0.0.0.0:8000 | |
codec: json | |
transforms: | |
remap: | |
type: remap | |
inputs: | |
- in | |
source: | | |
. = parse_json!(.message) | |
._vector.routingKey = .nested.flowID | |
sinks: | |
sink_amqp: | |
type: amqp | |
inputs: | |
- remap | |
connection_string: amqp://user:[email protected]:5672/%2f?timeout=10 | |
routing_key: "{{ ._vector.routingKey }}" | |
exchange: example | |
encoding: | |
except_fields: [_vector] | |
codec: json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment