Skip to content

Commit

Permalink
Fix system tests using logstash for ingest only write one event per d…
Browse files Browse the repository at this point in the history
…ata stream (#2117)
  • Loading branch information
aleksmaus authored Sep 23, 2024
1 parent 124778e commit 3992988
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions internal/stack/_static/logstash.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,26 @@ filter {
}

output {
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 }}
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 }}
}
}
}

0 comments on commit 3992988

Please sign in to comment.