Merge "Add Journalbeat support for OS LXC containers"
This commit is contained in:
commit
246362adf6
@ -77,6 +77,16 @@
|
|||||||
notify:
|
notify:
|
||||||
- Enable and restart journalbeat
|
- Enable and restart journalbeat
|
||||||
|
|
||||||
|
- name: Gather list of OS container journals
|
||||||
|
find:
|
||||||
|
path: "/var/log/journal/"
|
||||||
|
file_type: directory
|
||||||
|
register: journal_log_dirs
|
||||||
|
|
||||||
|
- name: Set container journal paths
|
||||||
|
set_fact:
|
||||||
|
journal_paths: "{{ journal_log_dirs.files | map(attribute='path') | list }}"
|
||||||
|
|
||||||
- name: Drop journalbeat configs
|
- name: Drop journalbeat configs
|
||||||
template:
|
template:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
|
@ -17,7 +17,7 @@ journalbeat.inputs:
|
|||||||
# Paths that should be crawled and fetched. Possible values files and directories.
|
# Paths that should be crawled and fetched. Possible values files and directories.
|
||||||
# When setting a directory, all journals under it are merged.
|
# When setting a directory, all journals under it are merged.
|
||||||
# When empty starts to read from local journal.
|
# When empty starts to read from local journal.
|
||||||
- paths: ["/var/log/journal"]
|
- paths: {{ journal_paths | to_json }}
|
||||||
|
|
||||||
# The number of seconds to wait before trying to read again from journals.
|
# The number of seconds to wait before trying to read again from journals.
|
||||||
backoff: 10s
|
backoff: 10s
|
||||||
|
Loading…
Reference in New Issue
Block a user