Authored by chunhua.zhang

add

1 - filebeat.prospectors:  
2 - - input_type: log  
3 - paths:  
4 - - /Data/logs/nginx/api.yoho.cn_access.log  
5 - document_type: nginx_access  
6 - fields:  
7 - source_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"  
8 - {% if dc == 'qcloud-az3' %}  
9 - region: "az3"  
10 - {% elif dc == 'qcloud-az2' %}  
11 - region: "az2"  
12 - {% elif dc == 'qcloud-az1' %}  
13 - region: "az1"  
14 - {% else %}  
15 - region: "unknown"  
16 - {% endif %}  
17 - fields_under_root: true  
18 - tail_files: true  
19 -  
20 - - input_type: log  
21 - paths:  
22 - - /Data/logs/nginx/api.yoho.cn_error.log  
23 - - /Data/logs/nginx/nginx_error.log  
24 - document_type: nginx_access_error  
25 - fields:  
26 - source_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"  
27 - {% if dc == 'qcloud-az3' %}  
28 - region: "az3"  
29 - {% elif dc == 'qcloud-az2' %}  
30 - region: "az2"  
31 - {% elif dc == 'qcloud-az1' %}  
32 - region: "az1"  
33 - {% else %}  
34 - region: "unknown"  
35 - {% endif %}  
36 - fields_under_root: true  
37 - tail_files: true  
38 - multiline.pattern: '^\d{4}'  
39 - multiline.negate: true  
40 - multiline.match: after  
41 -  
42 - output.kafka:  
43 - enabled: true  
44 - hosts: ["10.66.105.67:9092"]  
45 - topic: '%{[type]}'  
46 - compression: snappy  
47 - max_message_bytes: 10000000  
48 - worker: 2  
  1 +filebeat.prospectors:
  2 +- input_type: log
  3 + paths:
  4 + - /Data/logs/nginx/api.yoho.cn_access.log
  5 + document_type: nginx_access
  6 + fields:
  7 + source_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
  8 + region: "az1"
  9 + fields_under_root: true
  10 + tail_files: true
  11 +
  12 +- input_type: log
  13 + paths:
  14 + - /Data/logs/nginx/api.yoho.cn_error.log
  15 + - /Data/logs/nginx/nginx_error.log
  16 + document_type: nginx_access_error
  17 + fields:
  18 + source_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
  19 + region: "az1"
  20 + fields_under_root: true
  21 + tail_files: true
  22 + multiline.pattern: '^\d{4}'
  23 + multiline.negate: true
  24 + multiline.match: after
  25 +
  26 +output.kafka:
  27 + enabled: true
  28 + hosts: ["10.66.105.67:9092"]
  29 + topic: '%{[type]}'
  30 + compression: snappy
  31 + max_message_bytes: 10000000
  32 + worker: 2
@@ -5,15 +5,7 @@ filebeat.prospectors: @@ -5,15 +5,7 @@ filebeat.prospectors:
5 document_type: nginx_access 5 document_type: nginx_access
6 fields: 6 fields:
7 source_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}" 7 source_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
8 -{% if dc == 'qcloud-az3' %}  
9 - region: "az3"  
10 -{% elif dc == 'qcloud-az2' %}  
11 - region: "az2"  
12 -{% elif dc == 'qcloud-az1' %}  
13 region: "az1" 8 region: "az1"
14 -{% else %}  
15 - region: "unknown"  
16 -{% endif %}  
17 service: "ufo" 9 service: "ufo"
18 fields_under_root: true 10 fields_under_root: true
19 tail_files: true 11 tail_files: true
@@ -24,15 +16,7 @@ filebeat.prospectors: @@ -24,15 +16,7 @@ filebeat.prospectors:
24 document_type: nginx_access_error 16 document_type: nginx_access_error
25 fields: 17 fields:
26 source_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}" 18 source_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
27 -{% if dc == 'qcloud-az3' %}  
28 - region: "az3"  
29 -{% elif dc == 'qcloud-az2' %}  
30 - region: "az2"  
31 -{% elif dc == 'qcloud-az1' %}  
32 region: "az1" 19 region: "az1"
33 -{% else %}  
34 - region: "unknown"  
35 -{% endif %}  
36 service: "ufo" 20 service: "ufo"
37 fields_under_root: true 21 fields_under_root: true
38 tail_files: true 22 tail_files: true