Added openstack_barbican missing label
Since we have input.forwarders enabled which seeks for
openstack_barbican label, we need to add its configuration
to make fluentd workable.
Change-Id: I68b66f0bb841141f249d726fe9365cb8046e5c4a
Closes-Bug: PROD-26327
diff --git a/barbican/meta/fluentd.yml b/barbican/meta/fluentd.yml
index 2613779..36983de 100644
--- a/barbican/meta/fluentd.yml
+++ b/barbican/meta/fluentd.yml
@@ -16,6 +16,7 @@
tag: openstack.barbican.**
type: relabel
label: openstack_barbican
+ {%- if apache_wsgi %}
openstack_barbican_wsgi:
input:
barbican_api_wsgi_in_tail:
@@ -68,4 +69,68 @@
tag: 'metric.**'
type: relabel
label: default_metric
+ {%- endif %}
+ openstack_barbican:
+ filter:
+ set_programname:
+ tag: openstack.barbican.*
+ type: record_transformer
+ enable_ruby: true
+ record:
+ - name: programname
+ value: barbican-${ tag_parts[2] }
+ set_log_record_fields:
+ tag: openstack.barbican
+ type: record_transformer
+ enable_ruby: true
+ record:
+ - name: Severity
+ value: ${ {'TRACE'=>7,'DEBUG'=>7,'INFO'=>6,'AUDIT'=>6,'WARNING'=>4,'ERROR'=>3,'CRITICAL'=>2}[record['level']].to_i }
+ - name: severity_label
+ value: ${ record['level'] }
+ - name: Payload
+ value: ${ record['message'] }
+ - name: python_module
+ value: ${ record['name'] }
+ - name: programname
+ value: '${ record["programname"] ? record["programname"] : "barbican" }'
+ parse_http_stats:
+ tag: openstack.barbican
+ type: parser
+ key_name: Payload
+ reserve_data: true
+ emit_invalid_record_to_error: false
+ parser:
+ type: regexp
+ # Parse openstack http stats: https://regex101.com/r/Tf0XUK/1/
+ format: '\"(?<http_method>GET|POST|OPTIONS|DELETE|PUT|HEAD|TRACE|CONNECT|PATCH)\s(?<http_url>\S+)\s(?<http_version>[.\/\dHTFSP]+)\"\sstatus:\s(?<http_status>\d{3})\slen:\s(?<http_response_size>\d+)\stime:\s(?<http_response_time>\d+\.\d+)'
+ types: http_response_time:float
+ match:
+ unify_tag:
+ tag: openstack.barbican.*
+ type: rewrite_tag_filter
+ rule:
+ - name: level
+ regexp: '.*'
+ result: openstack.barbican
+ send_to_default:
+ tag: openstack.barbican
+ type: copy
+ store:
+ - type: relabel
+ label: default_output
+ - type: rewrite_tag_filter
+ rule:
+ - name: severity_label
+ regexp: '.'
+ result: metric.barbican_log_messages
+ - type: rewrite_tag_filter
+ rule:
+ - name: http_status
+ regexp: '.'
+ result: metric.barbican_openstack_http_response
+ push_to_metric:
+ tag: 'metric.**'
+ type: relabel
+ label: default_metric
{% endif %}