Dmitry Kalashnik | 541ffb4 | 2019-04-16 15:26:21 +0400 | [diff] [blame] | 1 | parameters: |
| 2 | fluentd: |
| 3 | agent: |
| 4 | config: |
| 5 | label: |
| 6 | rabbitmq_notifications: |
| 7 | input: |
| 8 | tail_rabbitmq_info: |
| 9 | tag: raw_notifications |
| 10 | type: rabbitmq |
| 11 | host: ${_param:openstack_message_queue_address} |
| 12 | user: openstack |
| 13 | pass: ${_param:rabbitmq_openstack_password} |
| 14 | vhost: /openstack |
| 15 | queue: ${_param:stacklight_notification_topic}.info |
| 16 | routing_key: ${_param:stacklight_notification_topic}.info |
| 17 | parser: |
| 18 | type: json |
| 19 | tail_rabbitmq_warn: |
| 20 | tag: raw_notifications |
| 21 | type: rabbitmq |
| 22 | host: ${_param:openstack_message_queue_address} |
| 23 | user: openstack |
| 24 | pass: ${_param:rabbitmq_openstack_password} |
| 25 | vhost: /openstack |
| 26 | queue: ${_param:stacklight_notification_topic}.warn |
| 27 | routing_key: ${_param:stacklight_notification_topic}.warn |
| 28 | parser: |
| 29 | type: json |
| 30 | tail_rabbitmq_error: |
| 31 | tag: raw_notifications |
| 32 | type: rabbitmq |
| 33 | host: ${_param:openstack_message_queue_address} |
| 34 | user: openstack |
| 35 | pass: ${_param:rabbitmq_openstack_password} |
| 36 | vhost: /openstack |
| 37 | queue: ${_param:stacklight_notification_topic}.error |
| 38 | routing_key: ${_param:stacklight_notification_topic}.error |
| 39 | parser: |
| 40 | type: json |
| 41 | filter: |
| 42 | parse_json: |
| 43 | tag: raw_notifications |
| 44 | type: parser |
| 45 | key_name: oslo.message |
| 46 | reserve_data: false |
| 47 | hash_value_field: parsed |
| 48 | parser: |
| 49 | type: json |
| 50 | remove_context: |
| 51 | tag: raw_notifications |
| 52 | require: |
| 53 | - parse_json |
| 54 | type: record_transformer |
| 55 | enable_ruby: true |
| 56 | remove_keys: _dummy_1 |
| 57 | record: |
| 58 | - name: _dummy_1 |
| 59 | value: ${fluentd:dollar}{record['parsed'].delete_if { |k,_| k.include?('_context_') }; nil} |
| 60 | pack_parsed_to_json: |
| 61 | tag: raw_notifications |
| 62 | require: |
| 63 | - remove_context |
| 64 | type: record_transformer |
| 65 | enable_ruby: true |
| 66 | record: |
| 67 | - name: parsed |
| 68 | value: ${fluentd:dollar}{record["parsed"].to_json} |
| 69 | unpack_on_top_level: |
| 70 | tag: raw_notifications |
| 71 | require: |
| 72 | - pack_parsed_to_json |
| 73 | type: parser |
| 74 | key_name: parsed |
| 75 | reserve_data: false |
| 76 | parser: |
| 77 | type: json |
| 78 | detect_audit_notification: |
| 79 | tag: raw_notifications |
| 80 | require: |
| 81 | - unpack_on_top_level |
| 82 | type: record_transformer |
| 83 | enable_ruby: true |
| 84 | record: |
| 85 | - name: notification_type |
Michal Kobus | 95355be | 2020-11-20 16:17:19 +0100 | [diff] [blame] | 86 | value: '${fluentd:dollar}{ record["payload"].key?("eventType") && record["payload"].key?("eventTime") ? "audit" : "notification" }' |
Dmitry Kalashnik | 541ffb4 | 2019-04-16 15:26:21 +0400 | [diff] [blame] | 87 | match: |
| 88 | rewrite_message_tag: |
| 89 | tag: raw_notifications |
| 90 | type: rewrite_tag_filter |
| 91 | rule: |
| 92 | - name: notification_type |
| 93 | regexp: 'audit' |
| 94 | result: audit |
| 95 | - name: notification_type |
| 96 | regexp: '/.+/' |
| 97 | result: notification |
| 98 | forward_notification: |
| 99 | tag: notification |
| 100 | type: relabel |
| 101 | label: notification_messages |
| 102 | forward_audit: |
| 103 | tag: audit |
| 104 | type: relabel |
| 105 | label: audit_messages |