2019-05-01 18:21:11 +00:00
|
|
|
---
|
2020-04-07 18:55:19 +00:00
|
|
|
layout: docs
|
|
|
|
page_title: 'Commands: Config Read'
|
2020-04-07 23:56:08 +00:00
|
|
|
sidebar_title: 'read'
|
2020-04-07 18:55:19 +00:00
|
|
|
sidebar_current: docs-commands-config-read
|
2019-05-01 18:21:11 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# Consul Config Read
|
|
|
|
|
|
|
|
Command: `consul config read`
|
|
|
|
|
2019-05-08 20:19:37 +00:00
|
|
|
The `config read` command reads the config entry specified by the given
|
2019-05-01 18:21:11 +00:00
|
|
|
kind and name and outputs its JSON representation. See the
|
2020-04-09 23:46:54 +00:00
|
|
|
[configuration entries docs](/docs/agent/config_entries) for more
|
2019-05-08 20:19:37 +00:00
|
|
|
details about configuration entries.
|
2019-05-01 18:21:11 +00:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
Usage: `consul config read [options]`
|
|
|
|
|
|
|
|
#### API Options
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
@include 'http_api_options_client.mdx'
|
2019-05-01 18:21:11 +00:00
|
|
|
|
2020-02-07 20:01:04 +00:00
|
|
|
#### Enterprise Options
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
@include 'http_api_namespace_options.mdx'
|
2020-02-07 20:01:04 +00:00
|
|
|
|
2019-05-01 18:21:11 +00:00
|
|
|
#### Config Read Options
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-kind` - Specifies the kind of the config entry to read.
|
2019-05-01 18:21:11 +00:00
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-name` - Specifies the name of the config entry to read.
|
2019-05-01 18:21:11 +00:00
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
$ consul config read -kind service-defaults -name web
|
|
|
|
{
|
|
|
|
"Kind": "service-defaults",
|
|
|
|
"Name": "web",
|
|
|
|
"Protocol": "http",
|
|
|
|
"CreateIndex": 13,
|
|
|
|
"ModifyIndex": 13
|
|
|
|
}
|