Closed SoTMaR closed 7 years ago
See the example in the wiki for how to do this. Bulkload is expecting key=value only without any other data.
Hi @agperson,
Thank you very much for your answer!
I tried that in the past without success:
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.
Thanks again!
Cheers, SoTMaR
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