Commit 9622a855 by ChongmingDu

Add filebeat

parent 0159629c
[local]
local1
local1 hostname=local1
[zabbix_server]
web1
......
......@@ -11,7 +11,7 @@
user:
name: tomcat
shell: /bin/bash
password: 1q2w3e4r
password: kk1q2w3e4r
remove: yes
- name: "Install git 2.9.5"
......@@ -24,3 +24,6 @@
- name: "Install git"
shell: "cd /usr/local/git-2.9.5/;./configure --prefix=/usr &>/dev/null;make -j 4&& make install &>/dev/null"
- name: "set hostname"
raw: hostnamectl set-hostname "{{hostname|quote}}"
\ No newline at end of file
---
- name: "restart filebeat"
service: name=filebeat state=restarted enabled=yes
\ No newline at end of file
- name: Install elastic repo
yum:
name: https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-5.6.12-x86_64.rpm
state: present
- name: Install filebeat 5.6.12
yum:
name: filebeat
state: present
- name: copy filebeat templates
template:
src: filebeat.yml
dest: /etc/filebeat/filebeat.yml
notify:
- restart filebeat
\ No newline at end of file
filebeat.prospectors:
- input_type: log
paths:
- /opt/tomcat/test-base-service/logs/base-service/base-service.log
multiline:
pattern: ^\d{4}\.\d{2}.\d{2}
negate: true
match: after
fields:
doc_type: crmtest-base-service
output.elasticsearch:
hosts: ["172.16.162.209:9200"]
index: "crmtest-%{+yyyy.MM.dd}"
indices:
- index: "crmtest-base-service-%{+yyyy.MM.dd}"
when.contains:
source: "/opt/tomcat/test-base-service/logs/base-service/base-service.log"
protocol: "http"
username: "elastic"
password: "changeme"
\ No newline at end of file
......@@ -7,7 +7,7 @@ LogFileSize=0
##### Passive checks related
Server=127.0.0.1
Server=172.16.162.209
### Option: ServerActive
......
......@@ -9,3 +9,5 @@
roles:
- base
- nginx
- zabbix_agent
- filebeat
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment