how can I configure the URI address of the HTTP sink using variables extracted from the remap transforms? #20767
Unanswered
loveyang2012
asked this question in
Q&A
Replies: 1 comment
-
Unfortunately this isn't possible yet. See #1155 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I send logs to openobserve by sink.http;
the original log like this:
{"contents": {"content": "prodnginx 200 499 0.020 180.120.167.213 96 [28/Jun/2024:18:27:51 +0800] "POST /mc/device/","host": "dmz-k-paas-16c-e-9.novalocal","namespace": "pushcenter","pod": "nginx-pushcenter-88d99c45b-dz5pg","service": "nginx-pushcenter"}}
the right configure is like this :
_[sources.a]
type = "file"
include = [ "/data/vector/json.log" ]
[transforms.b]
type = "remap"
inputs = [ "a" ]
source = """
. = parse_json!(string!(.message))
"""
[transforms.c]
type = "remap"
inputs = [ "b" ]
source = """
. = .contents
"""
[sinks.openobserver]
type = "http"
inputs = [ "c" ]
uri = "http://192.168.168.137:5080/api/default/nginx/_json"
method = "post"
auth.strategy = "basic"
auth.user = "[email protected]"
auth.password = "GzoDXJ7RXJMOTnoU"
compression = "gzip"
encoding.codec = "json"
encoding.timestamp_format = "rfc3339"
healthcheck.enabled = false_
but now I want to use a variable to config the uri ,like this
_uri = "http://192.168.168.137:5080/api/default/{{ .service }}/json"
it not works .
how can I do it ,now ?
Beta Was this translation helpful? Give feedback.
All reactions