From 2dc6417f8f6fa7be8974115e042eeebb3c832269 Mon Sep 17 00:00:00 2001 From: ac2550 Date: Tue, 8 May 2018 11:10:51 +0200 Subject: closedLoopAlarm dates in us not in ms Dates received from other services are in ms, not in ms. Change-Id: I3e2583f4d7f771a73b12d56c040941fa9d6494cc Signed-off-by: ac2550 Issue-ID: CLAMP-158 --- extra/docker/elk/logstash-conf/logstash.conf | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'extra/docker/elk') diff --git a/extra/docker/elk/logstash-conf/logstash.conf b/extra/docker/elk/logstash-conf/logstash.conf index dec47b3c5..0a2caf2f1 100644 --- a/extra/docker/elk/logstash-conf/logstash.conf +++ b/extra/docker/elk/logstash-conf/logstash.conf @@ -52,17 +52,19 @@ filter { } mutate { remove_field => [ "message" ] } # express timestamps in milliseconds instead of microseconds - ruby { - code => "event.set('closedLoopAlarmStart', Integer(event.get('closedLoopAlarmStart')))" - } - date { - match => [ "closedLoopAlarmStart", UNIX_MS ] - target => "closedLoopAlarmStart" + if [closedLoopAlarmStart] { + ruby { + code => "event.set('closedLoopAlarmStart', Integer(event.get('closedLoopAlarmStart')) / 1000)" + } + date { + match => [ "closedLoopAlarmStart", UNIX_MS ] + target => "closedLoopAlarmStart" + } } if [closedLoopAlarmEnd] { ruby { - code => "event.set('closedLoopAlarmEnd', Integer(event.get('closedLoopAlarmEnd')))" + code => "event.set('closedLoopAlarmEnd', Integer(event.get('closedLoopAlarmEnd')) / 1000)" } date { match => [ "closedLoopAlarmEnd", UNIX_MS ] -- cgit 1.2.3-korg