Today I Learned

Get key's value from Vault secret with multiple keys

Let’s assume that you have defined a secret in vault with multiple key’s defined:

➜ vault kv get secret/example
====== Metadata ======
Key              Value
---              -----
created_time     2020-03-12T12:25:24.912324854Z
deletion_time    n/a
destroyed        false
version          3

==== Data ====
Key      Value
---      -----
test     test1234
test2    dawdawaw

You can retrieve value from a specific key with a flag -field=key_name. For example:

➜ vault kv get -field=test2 secret/example
dawdawaw