-
Hello @TomWright, Can you give me any help with the following TOML file? I need to create it with dasel, but I am stuck how to achieve this example below
Thanks again! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
Hello @TomWright, The question is for the double bracket at the top and the search_base_dns, which starts with a bracket and ends with a bracket. Thanks! |
Beta Was this translation helpful? Give feedback.
-
In TOML the
You can then add the attributes to all server objects with this (notice the
Search_base_dns starts and ends with square brackets, meaning it is an array. You can create an array in dasel by using the
Example:
[[servers]]
bind_dn = "cn=admin,dc=grafana,dc=org"
bind_password = "grafana"
host = "127.0.0.1"
port = 389
search_base_dns = ["dc=grafana,dc=org"]
search_filter = "(cn=%s)"
ssl_skip_verify = false
start_tls = false
use_ssl = false
[servers.attributes]
email = "email"
member_of = "memberOf" |
Beta Was this translation helpful? Give feedback.
-
Thanks, I will look at it tonight or later this week! |
Beta Was this translation helpful? Give feedback.
-
Hello @TomWright, Still some struggeling, especially with the second and third [[ ]]. This is the final toml we do need. Could you please take a look at it?
Thanks again. |
Beta Was this translation helpful? Give feedback.
-
Hello @TomWright, Thanks, got it working. Wondering why it failed last night, somewhere a typo probably. |
Beta Was this translation helpful? Give feedback.
In TOML the
[[servers]]
tag is just appending an object to an array of objects.This can be achieved with the
[]
selector:You can then add the attributes to all server objects with this (notice the
-m
and[*]
targetting all servers items):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:Example: