-
Notifications
You must be signed in to change notification settings - Fork 719
/
logstash.yaml
190 lines (190 loc) · 4.65 KB
/
logstash.yaml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
---
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: elasticsearch
labels:
app.kubernetes.io/name: eck-logstash
app.kubernets.io/component: elasticsearch
spec:
version: 7.11.0
nodeSets:
- name: default
count: 3
config:
# This setting has performance implications. See the README for more details.
node.store.allow_mmap: false
---
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
name: kibana
labels:
app.kubernetes.io/name: eck-logstash
app.kubernets.io/component: kibana
spec:
version: 7.11.0
count: 1
elasticsearchRef:
name: elasticsearch
---
apiVersion: v1
kind: ConfigMap
metadata:
name: logstash-config
labels:
app.kubernetes.io/name: eck-logstash
app.kubernets.io/component: logstash
data:
logstash.yml: |
http.host: "0.0.0.0"
path.config: /usr/share/logstash/pipeline
---
apiVersion: v1
kind: ConfigMap
metadata:
name: logstash-pipeline
labels:
app.kubernetes.io/name: eck-logstash
app.kubernets.io/component: logstash
data:
logstash.conf: |
input {
beats {
port => 5044
}
}
filter {
grok {
match => { "message" => "%{COMBINEDAPACHELOG}"}
}
geoip {
source => "clientip"
}
}
output {
elasticsearch {
hosts => [ "${ES_HOSTS}" ]
user => "${ES_USER}"
password => "${ES_PASSWORD}"
cacert => '/etc/logstash/certificates/ca.crt'
}
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: logstash
labels:
app.kubernetes.io/name: eck-logstash
app.kubernets.io/component: logstash
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: eck-logstash
app.kubernets.io/component: logstash
template:
metadata:
labels:
app.kubernetes.io/name: eck-logstash
app.kubernets.io/component: logstash
spec:
containers:
- name: logstash
image: docker.elastic.co/logstash/logstash:7.10.1
ports:
- name: "tcp-beats"
containerPort: 5044
env:
- name: ES_HOSTS
value: "https://elasticsearch-es-http.default.svc:9200"
- name: ES_USER
value: "elastic"
- name: ES_PASSWORD
valueFrom:
secretKeyRef:
name: elasticsearch-es-elastic-user
key: elastic
volumeMounts:
- name: config-volume
mountPath: /usr/share/logstash/config
- name: pipeline-volume
mountPath: /usr/share/logstash/pipeline
- name: ca-certs
mountPath: /etc/logstash/certificates
readOnly: true
volumes:
- name: config-volume
configMap:
name: logstash-config
- name: pipeline-volume
configMap:
name: logstash-pipeline
- name: ca-certs
secret:
secretName: elasticsearch-es-http-certs-public
---
apiVersion: v1
kind: Service
metadata:
name: logstash
labels:
app.kubernetes.io/name: eck-logstash
app.kubernets.io/component: logstash
spec:
ports:
- name: "tcp-beats"
port: 5044
targetPort: 5044
selector:
app.kubernetes.io/name: eck-logstash
app.kubernets.io/component: logstash
---
apiVersion: beat.k8s.elastic.co/v1beta1
kind: Beat
metadata:
name: filebeat
labels:
app.kubernetes.io/name: eck-logstash
app.kubernets.io/component: filebeat
spec:
type: filebeat
version: 7.11.0
config:
filebeat.inputs:
- type: log
paths:
- /data/logstash-tutorial.log
output.logstash:
hosts: ["logstash.default.svc:5044"]
deployment:
podTemplate:
metadata:
labels:
app.kubernetes.io/name: eck-logstash
app.kubernets.io/component: filebeat
spec:
automountServiceAccountToken: true
initContainers:
- name: download-tutorial
image: curlimages/curl
command: ["/bin/sh"]
args: ["-c", "curl -L https://download.elastic.co/demos/logstash/gettingstarted/logstash-tutorial.log.gz | gunzip -c > /data/logstash-tutorial.log"]
volumeMounts:
- name: data
mountPath: /data
containers:
- name: filebeat
securityContext:
runAsUser: 0
volumeMounts:
- name: data
mountPath: /data
- name: beat-data
mountPath: /usr/share/filebeat/data
volumes:
- name: data
emptydir: {}
- name: beat-data
emptydir: {}