Authored by root

Split filebeat conf

@@ -8,4 +8,7 @@ @@ -8,4 +8,7 @@
8 shell: nohup /usr/share/filebeat/bin/filebeat -c /etc/filebeat/filebeat-"{{ group }}".yml & 8 shell: nohup /usr/share/filebeat/bin/filebeat -c /etc/filebeat/filebeat-"{{ group }}".yml &
9 9
10 - name: restart filebeat 10 - name: restart filebeat
11 - 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 & 11 + shell: service filebeat stop;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 &
  12 +
  13 +- name: restart filebeat
  14 + shell: service filebeat stop;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 &
@@ -20,9 +20,12 @@ @@ -20,9 +20,12 @@
20 state: installed 20 state: installed
21 update_cache: yes 21 update_cache: yes
22 22
23 -#- name: stop current filebeat  
24 -# command: killall -9 fileabeat  
25 -# ignore_errors: True 23 +- name: update filebeat base configuration file
  24 + template:
  25 + src: "base.yml"
  26 + dest: "/etc/filebeat/filebeat-base.yml"
  27 + notify:
  28 + - restart filebeat-base
26 29
27 - name: update filebeat configuration file 30 - name: update filebeat configuration file
28 template: 31 template: