File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,14 +21,26 @@ filter {
2121}
2222
2323output {
24- elasticsearch {
25- hosts = > [" {{ $elasticsearch_host }}" ]
26- user = > '{{ fact " username" }}'
27- password = > '{{ fact " password" }}'
28- ssl_enabled = > true
29- {{- if eq $elasticsearch_host " https://elasticsearch:9200" }}
30- ssl_certificate_authorities = > " /usr/share/logstash/config/certs/ca-cert.pem"
31- document_id = > " %{[@metadata][_ingest_document][id]}"
32- {{- end }}
24+ if [@metadata][_ingest_document][id] {
25+ elasticsearch {
26+ hosts = > [" {{ $elasticsearch_host }}" ]
27+ user = > '{{ fact " username" }}'
28+ password = > '{{ fact " password" }}'
29+ ssl_enabled = > true
30+ {{- if eq $elasticsearch_host " https://elasticsearch:9200" }}
31+ ssl_certificate_authorities = > " /usr/share/logstash/config/certs/ca-cert.pem"
32+ document_id = > " %{[@metadata][_ingest_document][id]}"
33+ {{- end }}
34+ }
35+ } else {
36+ elasticsearch {
37+ hosts = > [" {{ $elasticsearch_host }}" ]
38+ user = > '{{ fact " username" }}'
39+ password = > '{{ fact " password" }}'
40+ ssl_enabled = > true
41+ {{- if eq $elasticsearch_host " https://elasticsearch:9200" }}
42+ ssl_certificate_authorities = > " /usr/share/logstash/config/certs/ca-cert.pem"
43+ {{- end }}
44+ }
3345 }
3446}
You can’t perform that action at this time.
0 commit comments