Skip to content

Get YAML key which contains dot. #2692

Answered by mihaitodor
artemklevtsov asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @artemklevtsov, you can try root.src = file("./data.yaml").parse_yaml().get("k1~1k2"). The syntax is documented here: https://docs.redpanda.com/redpanda-connect/configuration/field_paths/

The characters ~ (%x7E) and . (%x2E) have special meaning in Redpanda Connect paths. Therefore ~ needs to be encoded as ~0 and . needs to be encoded as ~1 when these characters appear within a key.

Alternatively, this should also work: root.src = file("./data.yaml").parse_yaml()."k1.k2"

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@artemklevtsov
Comment options

Answer selected by artemklevtsov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants