ci: separate logs and metrics indices (#2544)

* separate logs and metrics indices

* tidy
This commit is contained in:
Moritz Sanft 2023-10-31 12:09:27 +01:00 committed by GitHub
parent 0c03076181
commit 9a282df846
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 35 deletions

View file

@ -93,7 +93,6 @@ func NewStartTrigger(ctx context.Context, wg *sync.WaitGroup, provider cloudprov
pipelineConf := logstashConfInput{
Port: 5044,
Host: openSearchHost,
IndexPrefix: "systemd-logs",
InfoMap: infoMapM,
Credentials: creds,
}
@ -272,7 +271,6 @@ func startPod(ctx context.Context, logger *logger.Logger) error {
type logstashConfInput struct {
Port int
Host string
IndexPrefix string
InfoMap map[string]string
Credentials credentials
}

View file

@ -55,12 +55,28 @@ filter {
}
output {
opensearch {
hosts => "{{ .Host }}"
index => "{{ .IndexPrefix }}-%{+YYYY.MM.dd}"
user => "{{ .Credentials.Username }}"
password => "{{ .Credentials.Password }}"
ssl => true
ssl_certificate_verification => true
if ([@metadata][beat] == "filebeat") {
# Logs, which are output by filebeat, go to the logs-index.
opensearch {
hosts => "{{ .Host }}"
# YYYY doesn't handle rolling over the year, so we use xxxx instead.
# See https://github.com/logstash-plugins/logstash-output-elasticsearch/issues/541#issuecomment-270923437.
index => "logs-%{+xxxx.ww}"
user => "{{ .Credentials.Username }}"
password => "{{ .Credentials.Password }}"
ssl => true
ssl_certificate_verification => true
}
} else {
opensearch {
hosts => "{{ .Host }}"
# YYYY doesn't handle rolling over the year, so we use xxxx instead.
# See https://github.com/logstash-plugins/logstash-output-elasticsearch/issues/541#issuecomment-270923437.
index => "metrics-%{+xxxx.ww}"
user => "{{ .Credentials.Username }}"
password => "{{ .Credentials.Password }}"
ssl => true
ssl_certificate_verification => true
}
}
}