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