Ingest non-standard Monasca logs

Presently, errors can appear in Fluentd and Monasca Log API logs due
to log output from some Monasca services, which do not use Oslo log,
being processed alongside other OpenStack logs which do.

This change parses these log files separately to prevent these errors.

Change-Id: Ie3cbb51424989b01727b5ebaaeba032767073462
This commit is contained in:
Doug Szumski 2019-06-14 14:07:45 +00:00
parent f1deb7467c
commit 4b31fdcf35
5 changed files with 32 additions and 1 deletions

View File

@ -56,6 +56,7 @@
- "06-zookeeper"
- "07-kafka"
- "08-opendaylight"
- "09-monasca"
notify:
- Restart fluentd container

View File

@ -34,4 +34,5 @@
rewriterule31 programname ^(vitrage-ml|vitrage-notifier|vitrage-graph)$ openstack_python
rewriterule32 programname ^(blazar-api|blazar-manager)$ openstack_python
rewriterule33 programname ^(cyborg-api|cyborg-conductor|cyborg-agent)$ openstack_python
rewriterule34 programname ^(agent-collector|agent-forwarder|agent-statsd)$ openstack_python
</match>

View File

@ -171,4 +171,9 @@
pattern ^(qinling-engine|qinling-api)$
tag openstack_python
</rule>
<rule>
key programname
pattern ^(agent-collector|agent-forwarder|agent-statsd)$
tag openstack_python
</rule>
</match>

View File

@ -44,7 +44,9 @@
<source>
@type tail
path {% for service, enabled in services if enabled | bool %}/var/log/kolla/{{ service }}/*.log{% if not loop.last %},{% endif %}{% endfor %}
exclude_path ["/var/log/kolla/neutron/dnsmasq.log",
exclude_path ["/var/log/kolla/monasca/agent*.log",
"/var/log/kolla/monasca/grafana.log",
"/var/log/kolla/neutron/dnsmasq.log",
"/var/log/kolla/*/*-access.log",
"/var/log/kolla/*/*-error.log"]
pos_file /var/run/{{ fluentd_dir }}/kolla-openstack.pos

View File

@ -0,0 +1,22 @@
<source>
@type tail
path /var/log/kolla/monasca/agent*.log
pos_file /var/run/fluentd/monasca-agent.pos
tag kolla.*
format multiline
format_firstline /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} \S+ \| \S+ \| \S+ \| .*$/
format1 /^(?<Timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} \S+) \| (?<log_level>\S+) \| (?<programname>\S+) \| (?<Payload>.*)$/
time_key Timestamp
</source>
<source>
@type tail
path /var/log/kolla/monasca/grafana.log
pos_file /var/run/fluentd/monasca-grafana.pos
tag infra.*
format multiline
format_firstline /^t=\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\+\d{4} lvl=\S+ msg=.*$/
format1 /^t=(?<Timestamp>\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\+\d{4}) lvl=(?<log_level>\S+) msg=(?<Payload>.*)$/
time_key Timestamp
</source>