Skip to content

Commit 569faaf

Browse files
Merge pull request #134 from pluralsh/better-logstash
Better logstash handling
2 parents db764f0 + 8f141b6 commit 569faaf

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

services/logstash/beat.yaml.liquid

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@ spec:
1717
type: container
1818
paths:
1919
- /var/log/containers/*${data.kubernetes.container.id}.log
20+
ignore_older: 24h
2021
output.logstash:
2122
hosts: ["logstash-ls-beats.elastic:5044"]
2223
processors:
2324
- add_cloud_metadata: {}
2425
- add_host_metadata: {}
26+
- add_kubernetes_metadata:
27+
node: ${NODE_NAME}
28+
add_resource_metadata:
29+
deployment: true
30+
cronjob: true
2531
- add_fields:
2632
target: cluster
2733
fields:

services/logstash/logstash.yaml.liquid

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,20 @@ spec:
1717
cpu: 500m
1818
pipelines:
1919
- pipeline.id: main
20+
# Defaults are 125 / 50ms; raise both to batch more events per cycle (fewer ES bulks, slightly higher latency).
21+
pipeline.batch.size: 200
22+
pipeline.batch.delay: 150
2023
config.string: |
2124
input {
2225
beats {
2326
port => 5044
2427
}
2528
}
2629
filter {
30+
age {}
31+
if [@metadata][age] > 86400 {
32+
drop {}
33+
}
2734
grok {
2835
match => { "message" => "%{HTTPD_COMMONLOG}"}
2936
}
@@ -39,6 +46,9 @@ spec:
3946
password => "${UPSTREAM_ES_PASSWORD}"
4047
index => "{{ contexts["plrl/cloud/observability"].elastic.user }}-logs-%{+YYYY.MM.dd}"
4148
manage_template => false
49+
# Longer timeout while ES is under merge/ILM load (default 60s).
50+
timeout => 120
51+
retry_max_interval => 120
4252
}
4353
}
4454
services:

0 commit comments

Comments
 (0)