#jinja2: trim_blocks: False
{% set fluentd_dir = 'td-agent' if kolla_base_distro in ['ubuntu', 'debian'] else 'fluentd' %}
{% set services = [
    ( 'aodh', enable_aodh ),
    ( 'barbican', enable_barbican ),
    ( 'blazar', enable_blazar ),
    ( 'ceilometer', enable_ceilometer ),
    ( 'cinder', enable_cinder ),
    ( 'cloudkitty', enable_cloudkitty ),
    ( 'congress', enable_congress ),
    ( 'cyborg', enable_cyborg ),
    ( 'designate', enable_designate ),
    ( 'freezer', enable_freezer ),
    ( 'glance', enable_glance ),
    ( 'gnocchi', enable_gnocchi ),
    ( 'heat', enable_heat ),
    ( 'horizon', enable_horizon ),
    ( 'ironic', enable_ironic ),
    ( 'ironic-inspector', enable_ironic ),
    ( 'karbor', enable_karbor ),
    ( 'keystone', enable_keystone ),
    ( 'kuryr', enable_kuryr ),
    ( 'magnum', enable_magnum ),
    ( 'manila', enable_manila ),
    ( 'mistral', enable_mistral ),
    ( 'monasca', enable_monasca ),
    ( 'mongodb', enable_mongodb ),
    ( 'murano', enable_murano ),
    ( 'neutron', enable_neutron ),
    ( 'nova', enable_nova ),
    ( 'octavia', enable_octavia ),
    ( 'panko', enable_panko ),
    ( 'rally', enable_rally ),
    ( 'sahara', enable_sahara ),
    ( 'searchlight', enable_searchlight ),
    ( 'senlin', enable_senlin ),
    ( 'solum', enable_solum ),
    ( 'tacker', enable_tacker ),
    ( 'trove', enable_trove ),
    ( 'watcher', enable_watcher ),
    ( 'zun', enable_zun )
] %}
<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/monasca/agent*.log",
                "/var/log/kolla/monasca/grafana.log",
                "/var/log/kolla/monasca/monasca-log-api.log",
                "/var/log/kolla/neutron/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/{{ fluentd_dir }}/kolla-openstack.pos
  tag kolla.*
  format multiline
  format_firstline /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3} \d+ \S+ \S+ \[(req-\S+ \S+ \S+ \S+ \S+ \S+|-)\]/
  format1 /^(?<Timestamp>\S+ \S+) (?<Pid>\d+) (?<log_level>\S+) (?<python_module>\S+) (\[(req-(?<request_id>\S+) (?<user_id>\S+) (?<tenant_id>\S+) (?<domain_id>\S+) (?<user_domain>\S+) (?<project_domain>\S+)|-)\])? (?<Payload>.*)?$/
  time_key Timestamp
  keep_time_key true
  time_format %F %T.%L
  ignore_repeated_permission_error true
  enable_watch_timer false
</source>
