fix: add support for url-encoded vector-sink config values

We additionally force-replace \u0026 with an ampersand to ensure we properly support & in config values (such as for URIs).
This commit is contained in:
Jose Diaz-Gonzalez
2021-09-10 23:04:41 -04:00
parent 2c4fec77bb
commit 0997fd3347
3 changed files with 38 additions and 0 deletions

View File

@@ -197,4 +197,13 @@ Valid values for `SINK_TYPE` include all log vector log sinks, while `SINK_OPTIO
- `[int]`: form: `key[]=int`
- `table`: form: `option[key]=value`
For some sinks - such as the `http` sink - it may be useful to use special characters such as `&`. These characters must be url escaped as per [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986.html).
```shell
# the following command will set the `http` sink with a uri config value
# for a uri config value: https://loggerservice.com:1234/?token=abc1234&type=vector
# the url quoted version: https%3A//loggerservice.com%3A1234/%3Ftoken%3Dabc1234%26type%3Dvector
dokku logs:set test vector-sink "http://?uri=https%3A//loggerservice.com%3A1234/%3Ftoken%3Dabc1234%26type%3Dvector"
```
Please read the [sink documentation](https://vector.dev/docs/reference/sinks/) for your sink of choice to configure the sink as desired.