31 lines
780 B
YAML
31 lines
780 B
YAML
|
---
|
||
|
- name: Converge
|
||
|
hosts: all
|
||
|
roles:
|
||
|
- ansible-role-logstash
|
||
|
vars:
|
||
|
logstash_plugins:
|
||
|
- name: logstash-output-influxdb
|
||
|
logstash_patterns:
|
||
|
postfix: |
|
||
|
# Syslog stuff
|
||
|
PROCESS ([\w._\/%-]+)
|
||
|
COMPID postfix\/%{PROCESS:process}(?:\[%{NUMBER:pid}\])?
|
||
|
POSTFIX (?:%{SYSLOGTIMESTAMP:timestamp}|%{TIMESTAMP_ISO8601:timestamp8601}) (?:%{SYSLOGFACILITY} )?%{SYSLOGHOST:logsource} %{COMPID}:
|
||
|
logstash_inputs:
|
||
|
- >
|
||
|
file {
|
||
|
path => "/var/log/syslog"
|
||
|
}
|
||
|
logstash_outputs:
|
||
|
- >
|
||
|
file {
|
||
|
path => "/tmp/logstash.log"
|
||
|
codec => "json"
|
||
|
}
|
||
|
pre_tasks:
|
||
|
- name: update apt cache
|
||
|
ansible.builtin.apt:
|
||
|
update_cache: true
|
||
|
cache_valid_time: 3600
|