Skip to content

Instantly share code, notes, and snippets.

@aramperes
Created March 11, 2025 00:27
Show Gist options
  • Save aramperes/0b84a1fc3ad1d89915e03187fdb13e5f to your computer and use it in GitHub Desktop.
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
# 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