-
Notifications
You must be signed in to change notification settings - Fork 116
/
logstash.conf.tmpl
46 lines (44 loc) · 1.37 KB
/
logstash.conf.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
input {
elastic_agent {
port => 5044
ssl_enabled => true
ssl_certificate_authorities => ["/usr/share/logstash/config/certs/ca-cert.pem"]
ssl_certificate => "/usr/share/logstash/config/certs/cert.pem"
ssl_key => "/usr/share/logstash/config/certs/key.pem"
}
}
{{ $elasticsearch_host := fact "elasticsearch_host" -}}
filter {
elastic_integration {
remove_field => ['@version']
hosts => ["{{ $elasticsearch_host }}"]
username => '{{ fact "username" }}'
password => '{{ fact "password" }}'
ssl_enabled => true
ssl_verification_mode => "none"
}
}
output {
if [@metadata][_ingest_document][id] {
elasticsearch {
hosts => ["{{ $elasticsearch_host }}"]
user => '{{ fact "username" }}'
password => '{{ fact "password" }}'
ssl_enabled => true
{{- if eq $elasticsearch_host "https://elasticsearch:9200" }}
ssl_certificate_authorities => "/usr/share/logstash/config/certs/ca-cert.pem"
document_id => "%{[@metadata][_ingest_document][id]}"
{{- end }}
}
} else {
elasticsearch {
hosts => ["{{ $elasticsearch_host }}"]
user => '{{ fact "username" }}'
password => '{{ fact "password" }}'
ssl_enabled => true
{{- if eq $elasticsearch_host "https://elasticsearch:9200" }}
ssl_certificate_authorities => "/usr/share/logstash/config/certs/ca-cert.pem"
{{- end }}
}
}
}