LinuxCommandLibrary

consul-kv

distributed key-value store management

TLDR

Get a key's value

$ consul kv get [key]
copy
Put a value
$ consul kv put [key] [value]
copy
Delete a key
$ consul kv delete [key]
copy
List keys with a prefix
$ consul kv get -keys [prefix/]
copy
Get with recurse
$ consul kv get -recurse [prefix/]
copy
Export all keys
$ consul kv export [prefix/] > [backup.json]
copy
Import keys
$ consul kv import @[backup.json]
copy

SYNOPSIS

consul kv subcommand [options]

DESCRIPTION

consul kv manages Consul's key-value store, a distributed data store for configuration and service discovery. Values can be strings, JSON, or binary data.
Part of HashiCorp Consul, the KV store is commonly used for dynamic configuration, feature flags, and service coordination.

PARAMETERS

-keys

List only keys, not values.
-recurse
Retrieve all keys with the prefix.
-base64
Encode/decode values as base64.

SUBCOMMANDS

get

Retrieve a value from the KV store.
put
Set a value in the KV store.
delete
Remove a key from the KV store.
export
Export KV pairs in JSON format.
import
Import KV pairs from JSON.

SEE ALSO

consul(1), etcdctl(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community