# Schlüssel anhand eines Präfixes abrufen

> Anleitung zum Abrufen von etcd-Schlüsseln anhand ihres Präfixes

---

LLMS-Index: [llms.txt](/de/llms.txt)

---

## Voraussetzungen {#pre-requisites}

* [etcdctl installieren](/de/docs/etcd/install/)
* [Lokalen Cluster einrichten](/de/docs/etcd/dev-guide/local_cluster/)

## Schlüssel anhand eines Präfixes abrufen {#get-keys-by-prefix}

```bash
$ etcdctl --endpoints=$ENDPOINTS get PREFIX --prefix
```

### Globale Optionen {#global-options}

```bash
--endpoints=[127.0.0.1:2379], gRPC endpoints
```

### Optionen {#options}

```bash
--prefix, get a range of keys with matching prefix
```

### Beispiel {#example}

![03_etcdctl_get_by_prefix_2016050501](/docs/etcd/tasks/img/get-by-prefix.gif)

```shell
etcdctl --endpoints=$ENDPOINTS put web1 value1
etcdctl --endpoints=$ENDPOINTS put web2 value2
etcdctl --endpoints=$ENDPOINTS put web3 value3

etcdctl --endpoints=$ENDPOINTS get web --prefix
```
