You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
RESULT [{"Key":"project/","CreateIndex":1730,"ModifyIndex":1730,"LockIndex":0,"Flags":0,"Value":"","Session":""},{"Key":"project/environment/some.other.property","CreateIndex":1736,"ModifyIndex":1736,"LockIndex":0,"Flags":0,"Value":"some.other.value","Session":""},{"Key":"project/environment/some.property","CreateIndex":1733,"ModifyIndex":1733,"LockIndex":0,"Flags":0,"Value":"some.value","Session":""}]
Then, I try to restore those same backups with consul-cli kv bulkload:
(as JSON)
consul-cli kv bulkload --consul=XXX.YYY.com:8500 --json=export.json
Error: json: cannot unmarshal array into Go value of type map[string]interface {}
(as "pretty" JSON)
consul-cli kv bulkload --consul=XXX.YYY:8500 --json=prettyexport.json
Error: json: cannot unmarshal array into Go value of type map[string]interface {}
I would have expected to be able to use the result of the read as input for the bulkload but it doesn't seem to be the case. What am I doing wrong?
Thank you in advance,
SoTMaR
The text was updated successfully, but these errors were encountered:
cat prettyexport.json | jq from_entries
jq: error: Cannot use null as object key
jq: error: Cannot use null as object key
jq: error: Cannot use null as object key
null
Nevertheless, thanks to your comment and this jq issue, I found out that my CentOS was using jq 1.3 but the fix was added to later versions. I got jq 1.5 and everything is now working as expected.
Hi guys,
I need some assistance...
I'm trying to backup/restore my consul KV store via consul-cli and facing the following problem.
First, I "backup" the current KV store with consul-cli kv read:
(as JSON)
consul-cli kv read "" --consul=XXX.YYY.com:8500 --recurse=true --format=json > export.json
RESULT
[{"Key":"project/","CreateIndex":1730,"ModifyIndex":1730,"LockIndex":0,"Flags":0,"Value":"","Session":""},{"Key":"project/environment/some.other.property","CreateIndex":1736,"ModifyIndex":1736,"LockIndex":0,"Flags":0,"Value":"some.other.value","Session":""},{"Key":"project/environment/some.property","CreateIndex":1733,"ModifyIndex":1733,"LockIndex":0,"Flags":0,"Value":"some.value","Session":""}]
(as "pretty" JSON)
consul-cli kv read "" --consul=XXX.YYY.com:8500 --recurse=true --format=prettyjson > prettyexport.json
RESULT
Then, I try to restore those same backups with consul-cli kv bulkload:
(as JSON)
(as "pretty" JSON)
I would have expected to be able to use the result of the read as input for the bulkload but it doesn't seem to be the case. What am I doing wrong?
Thank you in advance,
SoTMaR
The text was updated successfully, but these errors were encountered: