Skip to content

Commit a5bfc11

Browse files
gitlayzergitlayzer
andauthored
修改 logstash,将 elastic 的配置抽到模板 (#22)
* add logstash template * update logstash template config --------- Co-authored-by: gitlayzer <18037803502@163.com>
1 parent 5ca753a commit a5bfc11

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

template/logstash/index.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,21 @@ spec:
1818
type: string
1919
value: logstash-${{ random(8) }}
2020
inputs:
21-
elasticsearch_username:
21+
ELASTICSEARCH_USERNAME:
2222
description: "Elasticsearch username for Logstash output"
2323
type: string
2424
default: "elastic"
2525
required: true
26-
elasticsearch_password:
26+
ELASTICSEARCH_PASSWORD:
2727
description: "Elasticsearch password for Logstash output"
2828
type: string
2929
default: ""
3030
required: true
31+
ELASTICSEARCH_HOST:
32+
description: "Elasticsearch host for Logstash output"
33+
type: string
34+
default: "elasticsearch.logging.svc.cluster.local:9200"
35+
required: true
3136

3237
---
3338
apiVersion: v1
@@ -87,9 +92,9 @@ data:
8792
8893
output {
8994
elasticsearch {
90-
hosts => ["http://elasticsearch.logging.svc.cluster.local:9200"]
91-
user => "${ELASTICSEARCH_USERNAME}"
92-
password => "${ELASTICSEARCH_PASSWORD}"
95+
hosts => ["http://${{ inputs.ELASTICSEARCH_HOST }}"]
96+
user => "${{ inputs.ELASTICSEARCH_USERNAME }}"
97+
password => "${{ inputs.ELASTICSEARCH_PASSWORD }}"
9398
index => "logstash-%{+YYYY.MM.dd}"
9499
ilm_enabled => false
95100
}

0 commit comments

Comments
 (0)