Using etcdctl I can do get <key name>
and retrieve the latest value. But, if I want to see previous values I need to add --rev=<some rev ID>
.
How can I find out what the revID is for the latest value, so I can know what to put in to get --rev=<latest -1>
Alternatively, is there a way to get the last n revisions of a value?
Doing get --order=DESCEND --sort-by=MODIFY --limit=3 <key name>
only returns a single value even though, in this case, --rev=785
returns the latest value, and --rev=784
returns the previous one.
Thanks, Paul
The standard output format does not give you the metadata information that you are looking for. It is there in the json version of the output. the following should get you the data, and use jq to extract the current revision.