Skip to content

Help with TOML #114

Answered by TomWright
ghost asked this question in Q&A
Apr 4, 2021 · 5 comments · 4 replies
Discussion options

You must be logged in to vote

In TOML the [[servers]] tag is just appending an object to an array of objects.
This can be achieved with the [] selector:

dasel put object -p toml -t string '.servers.[]' 'host=127.0.0.1'

You can then add the attributes to all server objects with this (notice the -m and [*] targetting all servers items):

dasel put object -p toml -t string -t string -m '.servers.[*].attributes' member_of=memberOf email=email

Search_base_dns starts and ends with square brackets, meaning it is an array. You can create an array in dasel by using the [0] selector which targets the first element in an array:

dasel put string -p toml -m '.servers.[*].search_base_dns.[0]' dc=grafana,dc=org

Example:

echo '' | …

Replies: 5 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@TomWright
Comment options

@ghost
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by TomWright
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@TomWright
Comment options

@TomWright
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #113 on April 05, 2021 12:37.