-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02_filebeat.config
More file actions
53 lines (53 loc) · 1.54 KB
/
02_filebeat.config
File metadata and controls
53 lines (53 loc) · 1.54 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
49
50
51
52
53
files:
"/etc/filebeat/filebeat.yml":
mode: "000755"
owner: root
group: root
content: |
filebeat:
prospectors:
- paths: [/var/app/current/logs/service.log*]
enabled: true
input_type: log
document_type: json
fields:
context: service_log
service: service_name_here
fields_under_root: true
ignore_older: 4h
scan_frequency: 10s
tail_files: true
- paths: [/var/log/nginx/access.log]
enabled: true
input_type: log
document_type: log
fields:
context: nginx_access
service: service_nginx_access
fields_under_root: true
ignore_older: 4h
scan_frequency: 10s
tail_files: true
- paths: [/var/log/nginx/error.log]
enabled: true
input_type: log
document_type: log
fields:
context: nginx_error
service: service_nginx_err
fields_under_root: true
ignore_older: 4h
scan_frequency: 10s
tail_files: true
output:
logstash:
hosts: ['elk.xxx.net:5044']
commands:
1_command:
command: "curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-5.0.1-x86_64.rpm"
cwd: /home/ec2-user
2_command:
command: "rpm -ivh --replacepkgs filebeat-5.0.1-x86_64.rpm"
cwd: /home/ec2-user
3_command:
command: "/etc/init.d/filebeat restart"