1 # Copyright © 2018 AT&T, Amdocs, Bell Canada Intellectual Property. All rights reserved.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
19 url => "${dmaap_base_url}/events/${event_topic}/${dmaap_consumer_group}/${dmaap_consumer_id}?timeout=15000"
21 Accept => "application/json"
23 add_field => { "topic" => "${event_topic}" }
26 notification_queue => {
28 url => "${dmaap_base_url}/events/${notification_topic}/${dmaap_consumer_group}/${dmaap_consumer_id}?timeout=15000"
30 Accept => "application/json"
32 add_field => { "topic" => "${notification_topic}" }
33 type => "dmaap_notification"
37 url => "${dmaap_base_url}/events/${request_topic}/${dmaap_consumer_group}/${dmaap_consumer_id}?timeout=15000"
39 Accept => "application/json"
41 add_field => { "topic" => "${request_topic}" }
42 type => "dmaap_request"
53 if [type] != "dmaap_log" {
54 # avoid noise if no entry in the list
55 if [message] == "[]" {
59 # parse json, split the list into multiple events, and parse each event
74 mutate { remove_field => [ "message" ] }
77 # express timestamps in milliseconds instead of microseconds
80 if event.get('closedLoopAlarmStart').to_s.to_i(10) > 9999999999999
81 event.set('closedLoopAlarmStart', event.get('closedLoopAlarmStart').to_s.to_i(10) / 1000)
83 event.set('closedLoopAlarmStart', event.get('closedLoopAlarmStart').to_s.to_i(10))
88 match => [ "closedLoopAlarmStart", UNIX_MS ]
89 target => "closedLoopAlarmStart"
92 if [closedLoopAlarmEnd] {
95 if event.get('closedLoopAlarmEnd').to_s.to_i(10) > 9999999999999
96 event.set('closedLoopAlarmEnd', event.get('closedLoopAlarmEnd').to_s.to_i(10) / 1000)
98 event.set('closedLoopAlarmEnd', event.get('closedLoopAlarmEnd').to_s.to_i(10))
103 match => [ "closedLoopAlarmEnd", UNIX_MS ]
104 target => "closedLoopAlarmEnd"
108 #"yyyy-MM-dd HH:mm:ss"
109 if [notificationTime] {
112 "notificationTime", " ", "T"
116 match => [ "notificationTime", ISO8601 ]
117 target => "notificationTime"
126 if [http_request_failure] {
129 hosts => ["${elasticsearch_base_url}"]
130 index => "errors-%{+YYYY.MM.DD}"
131 doc_as_upsert => true
136 hosts => ["${elasticsearch_base_url}"]
137 index => "logstash-%{+YYYY.MM.DD}" # creates daily indexes
138 doc_as_upsert => true