java-nginx.yml
1.31 KB
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
filebeat.prospectors:
- input_type: log
paths:
- /Data/logs/nginx/api.yoho.cn_access.log
document_type: metrics
fields:
source_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
fields_under_root: true
tail_files: true
- input_type: log
paths:
- /Data/logs/nginx/access_union.log
document_type: metrics
fields:
source_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
nginx_type: "union"
fields_under_root: true
tail_files: true
- input_type: log
paths:
- /Data/logs/nginx/nginx_error.log
document_type: metrics
fields:
source_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
nginx_type: "union"
fields_under_root: true
tail_files: true
multiline.pattern: '^\d{4}'
multiline.negate: true
multiline.match: after
- input_type: log
paths:
- /Data/logs/nginx/api.yoho.cn_error.log
document_type: metrics
fields:
source_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
fields_under_root: true
tail_files: true
multiline.pattern: '^\d{4}'
multiline.negate: true
multiline.match: after
output.kafka:
enabled: true
hosts: ["{{ kafka_hosts }}"]
topic: '%{[type]}'
compression: snappy
max_message_bytes: 10000000
worker: 2