-
Notifications
You must be signed in to change notification settings - Fork 0
/
filebeat_playbook_dnsoverhttps
41 lines (34 loc) · 1.09 KB
/
filebeat_playbook_dnsoverhttps
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
---
- name: Provision hosts with filebeat capabilities
hosts: all
become: yes
tasks:
- name: Install all galaxy roles
shell: ansible-galaxy install elastic.beats,v7.17.0 --roles-path="/etc/ansible/roles"
# https://www.elastic.co/guide/en/beats/filebeat/8.0/file-output.html
- name: Installing filebeat for collection
include_role:
name: elastic.beats
vars:
beat: "filebeat"
beat_conf:
filebeat.inputs:
- type: filestream
enabled: true
paths:
- "/var/log/nginx/dns.access.log"
fields:
filename: "dns.access.log"
- type: filestream
enabled: true
paths:
- "/var/log/doh-server.log"
fields:
filename: "doh-server.log"
output_conf:
file:
path: "/tmp"
filename: "filebeat.json"
# Too small rotation can cause data-loss
rotate_every_kb: 500000
use_repository: "true"