Authored by root

Update bigdata inventory file

... ... @@ -5,6 +5,7 @@
private: no
vars:
- kafka_hosts: "ops.ckafka.yohoops.org:9092"
- config_group: "{{ config_group }}"
remote_user: root
roles:
- role: filebeat
... ...
... ... @@ -2,13 +2,13 @@
# handlers file for filebeat
- name: stop filebeat
shell: ps aux|grep filebeat-"{{ group }}".yml|grep -v grep|head -n1|awk '{print $2}'|xargs -i kill -9 {}
shell: ps aux|grep filebeat-"{{ config_group }}".yml|grep -v grep|head -n1|awk '{print $2}'|xargs -i kill -9 {}
- name: start filebeat
shell: nohup /usr/share/filebeat/bin/filebeat -c /etc/filebeat/filebeat-"{{ group }}".yml -path.data /usr/share/filebeat/bin/data/"{{ group }}" -path.logs /usr/share/filebeat/bin/logs/"{{ group }}"&
shell: nohup /usr/share/filebeat/bin/filebeat -c /etc/filebeat/filebeat-"{{ config_group }}".yml -path.data /usr/share/filebeat/bin/data/"{{ config_group }}" -path.logs /usr/share/filebeat/bin/logs/"{{ config_group }}"&
- name: restart filebeat
shell: ps aux|grep filebeat-"{{ group }}".yml|grep -v grep|head -n1|awk '{print $2}'|xargs -i kill -9 {} ; nohup /usr/share/filebeat/bin/filebeat -c /etc/filebeat/filebeat-"{{ group }}".yml -path.data /usr/share/filebeat/bin/data/"{{ group }}" -path.logs /usr/share/filebeat/bin/logs/"{{ group }}"&
shell: ps aux|grep filebeat-"{{ config_group }}".yml|grep -v grep|head -n1|awk '{print $2}'|xargs -i kill -9 {} ; nohup /usr/share/filebeat/bin/filebeat -c /etc/filebeat/filebeat-"{{ config_group }}".yml -path.data /usr/share/filebeat/bin/data/"{{ config_group }}" -path.logs /usr/share/filebeat/bin/logs/"{{ config_group }}"&
- name: restart filebeat-base
shell: ps aux|grep filebeat-base.yml|grep -v grep|head -n1|awk '{print $2}'|xargs -i kill -9 {} ; nohup /usr/share/filebeat/bin/filebeat -c /etc/filebeat/filebeat-base.yml -path.data /usr/share/filebeat/bin/data/base -path.logs /usr/share/filebeat/bin/logs/base&
... ...
... ... @@ -38,7 +38,7 @@
- name: update filebeat configuration file
template:
src: "{{ group }}.yml"
dest: "/etc/filebeat/filebeat-{{ group }}.yml"
src: "{{ config_group }}.yml"
dest: "/etc/filebeat/filebeat-{{ config_group }}.yml"
notify:
- restart filebeat
... ...
filebeat.prospectors:
- input_type: log
paths:
- /Data/logs/nginx/api.yoho.cn_access.log
document_type: nginx_access
fields:
source_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
{% if dc == 'qcloud-az3' %}
region: "az3"
{% elif dc == 'qcloud-az2' %}
region: "az2"
{% elif dc == 'qcloud-az1' %}
region: "az1"
{% else %}
region: "unknown"
{% endif %}
fields_under_root: true
tail_files: true
- input_type: log
paths:
- /Data/logs/nginx/api.yoho.cn_error.log
document_type: nginx_access_error
fields:
source_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
{% if dc == 'qcloud-az3' %}
region: "az3"
{% elif dc == 'qcloud-az2' %}
region: "az2"
{% elif dc == 'qcloud-az1' %}
region: "az1"
{% else %}
region: "unknown"
{% endif %}
fields_under_root: true
tail_files: true
multiline.pattern: '^\d{4}'
multiline.negate: true
multiline.match: after
output.logstash:
hosts: ["10.67.1.192:5044"]
... ...