lishuliang 900c2d20bb Fix the fluentd regexp to collect the logs
The default value of logging_context_format_string and
logging_user_identity_format has changed [1][2][3].
This is to correct fluentd to use the same format.

[1]ebdee7f399
[2]7ed065f38d

[3]https://review.opendev.org/c/openstack/oslo.log/+/838185

Closes-Bug: #1872220

Change-Id: Ide0079ef4d28e3a3fa60288a74b936531c52ce60
2023-05-24 09:04:18 +00:00

26 lines
1.1 KiB
Django/Jinja

#jinja2: trim_blocks: False
{% if fluentd_enabled_input_openstack_services | length > 0 -%}
<source>
@type tail
path {% for service in fluentd_enabled_input_openstack_services %}/var/log/kolla/{{ service }}/*.log{% if not loop.last %},{% endif %}{% endfor %}
exclude_path ["/var/log/kolla/neutron/dnsmasq.log",
"/var/log/kolla/ironic/dnsmasq.log",
"/var/log/kolla/*/*-access.log",
"/var/log/kolla/*/*-error.log",
"/var/log/kolla/*/*_access.log",
"/var/log/kolla/*/*_error.log"]
pos_file /var/run/td-agent/kolla-openstack.pos
tag kolla.*
ignore_repeated_permission_error true
enable_watch_timer false
<parse>
@type multiline
format_firstline /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3} \d+ \S+ \S+ \[.*\]/
format1 /^(?<Timestamp>\S+ \S+) (?<Pid>\d+) (?<log_level>\S+) (?<python_module>\S+) \[(\S+ req-)?((?<request_id>\S+) (?<user_id>\S+) (?<tenant_id>\S+) (?<domain_id>\S+) (?<system_scope>\S+) (?<user_domain>\S+) (?<project_domain>\S+)|-)\] (?<Payload>.*)?$/
time_key Timestamp
keep_time_key true
time_format %F %T.%L
</parse>
</source>
{%- endif %}