Skip to content
Snippets Groups Projects
Commit 31826809 authored by Juan Pablo Suazo's avatar Juan Pablo Suazo
Browse files

Enable the Fluentd Plugin Systemd


Adds configurations and changes tasks to enable the
systemd plugin. Additionaly, the plugin is set to
read logs from the /var/log/journal directory

Implements: enable-fluent-plugin-systemd
Signed-off-by: default avatarJuan Pablo Suazo <jsuazo@whitestack.com>
Change-Id: Ic714a341befa5f906d9c0f78fa86f4c934df87cd
parent 68ef87f8
No related branches found
No related tags found
No related merge requests found
......@@ -803,6 +803,7 @@ enable_cyborg: "no"
enable_designate: "no"
enable_etcd: "no"
enable_fluentd: "yes"
enable_fluentd_systemd: "{{ (enable_fluentd | bool) and (enable_central_logging | bool) }}"
enable_freezer: "no"
enable_gnocchi: "no"
enable_gnocchi_statsd: "no"
......
......@@ -120,6 +120,7 @@ fluentd_default_volumes:
- "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}"
- "kolla_logs:/var/log/kolla/"
- "fluentd_data:/var/lib/fluentd/data/"
- "/var/log/journal:/var/log/journal:ro"
kolla_toolbox_extra_volumes: "{{ default_extra_volumes }}"
cron_extra_volumes: "{{ default_extra_volumes }}"
fluentd_extra_volumes: "{{ default_extra_volumes }}"
......
......@@ -114,6 +114,8 @@
enabled: true
- name: "conf/input/11-letsencrypt.conf.j2"
enabled: "{{ enable_letsencrypt | bool }}"
- name: "conf/input/12-systemd.conf.j2"
enabled: "{{ enable_fluentd_systemd | bool }}"
customised_input_files: "{{ find_custom_fluentd_inputs.files | map(attribute='path') | list }}"
# Filters
fluentd_filter_files: "{{ default_filter_files | customise_fluentd(customised_filter_files) }}"
......
<source>
@type systemd
tag journal
path /var/log/journal
<entry>
fields_strip_underscores true
fields_lowercase true
</entry>
</source>
......@@ -26,6 +26,13 @@
"recurse": true
},
{% endfor %}
{% if enable_fluentd_systemd | bool %}
{
"path": "/var/log/journal",
"owner": "{{ fluentd_user }}:{{ fluentd_user }}",
"recurse": true
},
{% endif %}
{
"path": "/var/lib/fluentd/data",
"owner": "{{ fluentd_user }}:{{ fluentd_user }}",
......
......@@ -232,3 +232,13 @@ network equipment. This can be done by configuring custom fluentd inputs.
Configuration of custom fluentd inputs is possible by placing input
configuration files in ``/etc/kolla/config/fluentd/input/*.conf`` on the
control host.
Systemd Logs
------------
By default, when enabling central logging, we also enable reading ``systemd``
logs from the ``/var/log/journal`` file.
To disable this behavior when central logging is enabled, set the value of
the variable ``enable_fluentd_systemd`` to ``false`` in the configuration
file ``/etc/kolla/globals.yml``.
......@@ -345,6 +345,7 @@ workaround_ansible_issue_8743: yes
#enable_destroy_images: "no"
#enable_etcd: "no"
#enable_fluentd: "yes"
#enable_fluentd_systemd: "{{ (enable_fluentd | bool) and (enable_central_logging | bool) }}"
#enable_freezer: "no"
#enable_gnocchi: "no"
#enable_gnocchi_statsd: "no"
......
---
features:
- |
Implements [Enable Fluentd Plugin Systemd].
Adds the needed changes and configurations in order to use the
fluentd plugin, systemd, to read logs from /var/log/journal by
default. This allows us to read and manipulate this logs for
monitoring purposes.
These logs will be sent to OpenSearch by default, to disable this
behavior, set the value of the variable ``enable_fluentd_systemd``
to ``false`` in the configuration file ``/etc/kolla/globals.yml``.
By default, when enabling central logging, we also enable the
``systemd`` plugin. To disable this behavior when central logging
is enabled, set the value of the variable ``enable_fluentd_systemd``
to ``false`` in the configuration file ``/etc/kolla/globals.yml``.
fluent-plugin-systemd source:
https://github.com/fluent-plugin-systemd/fluent-plugin-systemd
`Blueprint enable-fluent-plugin-systemd
<https://blueprints.launchpad.net/kolla-ansible/+spec/enable-fluent-plugin-systemd>`__
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment