-
Notifications
You must be signed in to change notification settings - Fork 5
/
filebeat.yml.tmpl
57 lines (54 loc) · 2.64 KB
/
filebeat.yml.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
47
48
49
50
51
52
53
54
55
56
57
filebeat:
registry_file: /local/.filebeat
prospectors:
- input_type: log
document_type: {{ var "DOCUMENT_TYPE" | default "log" }}
paths:
- /alloc/logs/*.stdout.*
fields_under_root: {{ var "FIELDS_UNDER_ROOT" | default "true" }}
fields:
stream: stdout
{{ if var "ENVIRONMENT" }}environment: {{ var "ENVIRONMENT" }}{{ else }}#environment:{{ end }}
{{ if or $nomad_vars $meta_vars }}nomad:{{ if $nomad_vars }}{{ range $nomad_vars | split "," }}
{{ . | replace "NOMAD_" "" | lower }}: {{ var . }}{{ end }}{{ end }}
{{ if $meta_vars }}meta:{{ range $meta_vars | split "," }}
{{ . | replace "NOMAD_META_" "" | lower }}: {{ var . }}{{ end }}{{ end }}{{ end }}
{{ if eq (var "EXCLUDE_STDERR") "" }} - input_type: log
document_type: {{ var "DOCUMENT_TYPE" | default "log" }}
paths:
- /alloc/logs/*.stderr.*
fields_under_root: {{ var "FIELDS_UNDER_ROOT" | default "true" }}
fields:
stream: stderr
{{ if var "ENVIRONMENT" }}environment: {{ var "ENVIRONMENT" }}{{ else }}#environment:{{ end }}
{{ if or $nomad_vars $meta_vars }}nomad:{{ if $nomad_vars }}{{ range $nomad_vars | split "," }}
{{ . | replace "NOMAD_" "" | lower }}: {{ var . }}{{ end }}{{ end }}
{{ if $meta_vars }}meta:{{ range $meta_vars | split "," }}
{{ . | replace "NOMAD_META_" "" | lower }}: {{ var . }}{{ end }}{{ end }}{{ end }}{{ end }}
shipper:
{{ if var "NAME" }}name: {{ var "NAME" }}{{ else }}#name:{{ end }}
tags:{{ if var "TAGS" }}{{ range var "TAGS" | split "," }}
- "{{ . }}"{{ end }}{{ else }} []{{ end }}
output:
{{ if var "ES_HOST" }} elasticsearch:
hosts:{{ range var "ES_HOST" | split "," }}
- "{{ . }}"{{ end }}
index: {{ var "ES_INDEX" | default "filebeat" }}
protocol: {{ var "ES_PROTOCOL" | default "http" }}
username: {{ var "ES_USERNAME" | default "~" }}
password: {{ var "ES_PASSWORD" | default "~" }}{{ end }}
{{ if var "LOGSTASH_HOST" }} logstash:
hosts:{{ if var "LOGSTASH_HOST" }}{{ range var "LOGSTASH_HOST" | split "," }}
- "{{ . }}"{{ end }}{{else}} []{{end}}
port: {{ var "LOGSTASH_PORT" | default "10200" }}
index: {{ var "LOGSTASH_INDEX" | default "filebeat" }}
loadbalance: {{ var "LOGSTASH_LOADBALANCE" | default "false" }}{{ end }}
{{ if var "REDIS_HOST" }} redis:
host: {{ var "REDIS_HOST" }}
port: {{ var "REDIS_PORT" | default "6379" }}
db: {{ var "REDIS_DB" | default "0" }}
db_topology: {{ var "REDIS_DB_TOPOLOGY" | default "1" }}
password: {{ var "REDIS_PASSWORD" | default "~" }}{{ end }}
logging:
to_files: false
to_syslog: false