From 0e8a83dda5523270f6d132c49235d282e7e774e2 Mon Sep 17 00:00:00 2001 From: "Fu, Wei" Date: Tue, 19 Mar 2024 22:12:24 +0800 Subject: [PATCH] fix: 797 Signed-off-by: Fu, Wei --- .../tutorials/how-to-get-key-by-prefix.md | 27 ++++++++++++++++++- .../tutorials/how-to-get-key-by-prefix.md | 27 ++++++++++++++++++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/content/en/docs/v3.5/tutorials/how-to-get-key-by-prefix.md b/content/en/docs/v3.5/tutorials/how-to-get-key-by-prefix.md index ffb85e82..41503d44 100644 --- a/content/en/docs/v3.5/tutorials/how-to-get-key-by-prefix.md +++ b/content/en/docs/v3.5/tutorials/how-to-get-key-by-prefix.md @@ -4,6 +4,31 @@ description: Guide to extracting etcd keys by their prefix weight: 300 --- +## Pre-requisites + +* [Install etcdctl](https://etcd.io/docs/v3.5/install/) +* [Setup a local cluster](https://etcd.io/docs/v3.5/dev-guide/local_cluster/) + +## Get keys by prefix + +```bash +$ etcdctl --endpoints=$ENDPOINTS get PREFIX --prefix +``` + +### Global Options + +```bash +--endpoints=[127.0.0.1:2379], gRPC endpoints +``` + +### Options + +```bash +--prefix, get a range of keys with matching prefix +``` + +### Example + ![03_etcdctl_get_by_prefix_2016050501](https://storage.googleapis.com/etcd/demo/03_etcdctl_get_by_prefix_2016050501.gif) ```shell @@ -12,4 +37,4 @@ etcdctl --endpoints=$ENDPOINTS put web2 value2 etcdctl --endpoints=$ENDPOINTS put web3 value3 etcdctl --endpoints=$ENDPOINTS get web --prefix -``` \ No newline at end of file +``` diff --git a/content/en/docs/v3.6/tutorials/how-to-get-key-by-prefix.md b/content/en/docs/v3.6/tutorials/how-to-get-key-by-prefix.md index ffb85e82..6ff98629 100644 --- a/content/en/docs/v3.6/tutorials/how-to-get-key-by-prefix.md +++ b/content/en/docs/v3.6/tutorials/how-to-get-key-by-prefix.md @@ -4,6 +4,31 @@ description: Guide to extracting etcd keys by their prefix weight: 300 --- +## Pre-requisites + +* [Install etcdctl](https://etcd.io/docs/v3.6/install/) +* [Setup a local cluster](https://etcd.io/docs/v3.6/dev-guide/local_cluster/) + +## Get keys by prefix + +```bash +$ etcdctl --endpoints=$ENDPOINTS get PREFIX --prefix +``` + +### Global Options + +```bash +--endpoints=[127.0.0.1:2379], gRPC endpoints +``` + +### Options + +```bash +--prefix, get a range of keys with matching prefix +``` + +### Example + ![03_etcdctl_get_by_prefix_2016050501](https://storage.googleapis.com/etcd/demo/03_etcdctl_get_by_prefix_2016050501.gif) ```shell @@ -12,4 +37,4 @@ etcdctl --endpoints=$ENDPOINTS put web2 value2 etcdctl --endpoints=$ENDPOINTS put web3 value3 etcdctl --endpoints=$ENDPOINTS get web --prefix -``` \ No newline at end of file +```