Open rgarrigue opened 5 years ago
I will take care of it.
Vault has these options
Output Options:
-field=<string>
Print only the field with the given name. Specifying this option will
take precedence over other formatting directives. The result will not
have a trailing newline making it ideal for piping to other processes.
-format=<string>
Print the output in the given format. Valid formats are "table", "json",
or "yaml". The default is table. This can also be specified via the
VAULT_FORMAT environment variable.
Really hop consul can get these, e.g. consul acl token read -id $ACCESSOR_ID -format json
Is there any progress on this feature?
-format=json
to a bunch of the acl commands. It is available in 1.8.0. The first RC for 1.8.0 was just released.More work will need to be done to add the json format to all the other commands.
Just bumping this. It would be useful to get the info as json so that I could parse the output in systemd hooks to ensure the cluster is working as expected.
Feature Description
A global
-out [table|json]
option to modify the commands output from the current "table" to jsonor
Use Case(s)
consul CLI is very convenient for a bit of bash scripting, when one doesn't wan't to curl everything. One annoying bit is the "human readable" output, which need to be parsed to be exploitable. The good ol'
| grep | awk
and so on. But it's unreliable on the long term. Adding a "machine readable" output like json would allow using jq for a more sustainable result