[TOC]
# 使用Elastic Cloud
Logstash提供了兩個簡化使用[Elastic Cloud](https://cloud.elastic.co/)模塊的設置。 Elastic Cloud中的Elasticsearch和Kibana主機名可能很難在Logstash配置或命令行中設置,因此可以使用Cloud ID
> <font color=#DC143C size=4>NOTE</font>:Cloud ID只在Logstash模塊開啟的時候適用,其他情況下指定Cloud ID沒用。Cloud ID適用于通過模塊接收發送的數據,通過X-Pack監控發送的運行時指標,以及Logstash中X-Pack的集中管理特性使用的endpoint,除非顯示覆蓋了`logstash.yml`中對于X-Pack的設置。
>
> Cloud ID applies only when a Logstash module is enabled, otherwise specifying Cloud ID has no effect. Cloud ID applies to data that gets sent via the module, to runtime metrics sent via X-Pack monitoring, and to the endpoint used by X-Pack central management features of Logstash, unless explicit overrides to X-Pack settings are specified in `logstash.yml`.
## Cloud ID
在Elastic Cloud的web控制臺可以找到Cloud ID,Cloud ID是Logstash用來構建Elasticsearch和Kibana hosts設定的。它是一個base64編碼的文本值,大約120個字符,由大寫和小寫字母和數字組成。如果你有多個Cloud ID,則可以添加一個在內部被忽略的標簽,以幫助你區分它們。要添加標簽,你應該在Cloud ID前面加上標簽和分隔符,格式為“<label>:<cloud-id>”
`cloud.id`會覆蓋這些設定:
```text
var.elasticsearch.hosts
var.kibana.host
```
## Cloud Auth
可選,按照"<username>: <password>"的格式提供用戶名密碼。第一部分是用戶名。第二部分是密碼,在Cloud UI創建集群的時候提供的。密碼是可以更改的,所以如果在Cloud UI更改了密碼,記得把這里的密碼也進行修改。
`cloud.auth`會覆蓋這些設定:
```txt
var.elasticsearch.username
var.elasticsearch.password
var.kibana.username
var.kibana.password
```
示例:
這些設置可以在`logstash.yml`文件中指定。它們應與你之前添加的任何模塊配置設置分開添加。
```yaml
# example with a label
cloud.id: "staging:dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRub3RhcmVhbCRpZGVudGlmaWVy"
cloud.auth: "elastic:YOUR_PASSWORD"
```
```yaml
# example without a label
cloud.id: "dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRub3RhcmVhbCRpZGVudGlmaWVy"
cloud.auth: "elastic:YOUR_PASSWORD"
```
這些設置也可以通過命令行指定,像這樣:
```bash
bin/logstash --modules netflow -M "netflow.var.input.udp.port=3555" --cloud.id <cloud-id> --cloud.auth <cloud.auth>
```
- Emmm
- Logstash簡介
- 開始使用Logstash
- 安裝Logstash
- 儲存你的第一個事件
- 通過Logstash解析日志
- 多個輸入和輸出插件的混合使用
- Logstash是如何工作的
- 執行模型Execution Model
- 設置并運行Logstash
- Logstash目錄布局
- Logstash配置文件
- logstash.yml
- Secrets keystore for secure settings
- 從命令行運行Logstash
- 以服務的方式運行Logstash
- 在Docker中運行Logstash
- 配置容器版Logstash
- Logging
- 關閉Logstash
- 安裝X-Pack
- 設置X-Pack
- 升級Logstash
- 使用包管理升級
- 直接下載進行升級
- 升級至6.0
- Upgrading with the Persistent Queue Enabled
- 配置Logstash
- 管道配置文件的結構
- 訪問配置中的事件數據和字段
- 在配置中使用環境變量
- Logstash配置示例
- 多管道
- 管道間通信(beta)
- 重載配置文件
- 管理多行事件
- Glob Pattern Support
- Converting Ingest Node Pipelines
- Logstash間通信
- 配置集中式管道管理
- X-Pack Monitoring
- X-Pack Security
- X-Pack Settings
- Field References Deep Dive(深入字段引用)
- 管理Logstash
- 集中式管道管理
- 使用Logstash模塊
- 使用Elastic Cloud
- Logstash ArcSight模塊