From 5f2cc37d5b9e6688e890547d7b1caa0d4eed7a70 Mon Sep 17 00:00:00 2001 From: Joshua Rodriguez Date: Thu, 27 Jun 2024 15:03:38 -0700 Subject: [PATCH] Fixes issue where log entries were having their dates parsed incorrectly, causing errors in the ES index, this was causing out-of-date entries to appear in process log UI. --- install/cws-ui/history.ftl | 14 ++------------ .../console-db-es-ls-kibana/cws-logstash.conf | 2 +- install/docker/worker-ls/cws-logstash.conf | 2 +- install/logging/cws-logstash.conf | 2 +- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/install/cws-ui/history.ftl b/install/cws-ui/history.ftl index b180b605..29e408eb 100644 --- a/install/cws-ui/history.ftl +++ b/install/cws-ui/history.ftl @@ -1011,18 +1011,8 @@ console.error("Error getting instance JSON: " + xhr.responseText); }); logLines.sort(function(a, b) { - var aTemp = a[0]; - //if there is a space in the last char, remove it - if (aTemp.charAt(aTemp.length - 1) == " ") { - aTemp = aTemp.substring(0, aTemp.length - 1); - } - var bTemp = b[0]; - //if there is a space in the last char, remove it - if (bTemp.charAt(bTemp.length - 1) == " ") { - bTemp = bTemp.substring(0, bTemp.length - 1); - } - var aDate = moment(aTemp); - var bDate = moment(bTemp); + var aDate = moment(a[0].trim()); + var bDate = moment(b[0].trim()); if (aDate.isBefore(bDate)) return -1; if (bDate.isBefore(aDate)) return 1; return 0; diff --git a/install/docker/console-db-es-ls-kibana/cws-logstash.conf b/install/docker/console-db-es-ls-kibana/cws-logstash.conf index f6df9ba7..14c73109 100644 --- a/install/docker/console-db-es-ls-kibana/cws-logstash.conf +++ b/install/docker/console-db-es-ls-kibana/cws-logstash.conf @@ -33,7 +33,7 @@ filter { } date { - match => [ "logdate", "yyyy-MM-dd HH:mm:ss,SSS" ] + match => [ "logdate", "ISO8601" ] timezone => "UTC" locale => en remove_field => [ "logdate" ] diff --git a/install/docker/worker-ls/cws-logstash.conf b/install/docker/worker-ls/cws-logstash.conf index 801c7927..9179bc7e 100644 --- a/install/docker/worker-ls/cws-logstash.conf +++ b/install/docker/worker-ls/cws-logstash.conf @@ -33,7 +33,7 @@ filter { } date { - match => [ "logdate", "yyyy-MM-dd HH:mm:ss,SSS" ] + match => [ "logdate", "ISO8601" ] timezone => "UTC" locale => en remove_field => [ "logdate" ] diff --git a/install/logging/cws-logstash.conf b/install/logging/cws-logstash.conf index f2efd5fb..10dadeb0 100644 --- a/install/logging/cws-logstash.conf +++ b/install/logging/cws-logstash.conf @@ -34,7 +34,7 @@ filter { } date { - match => [ "logdate", "yyyy-MM-dd HH:mm:ss,SSS" ] + match => [ "logdate", "ISO8601" ] timezone => "UTC" locale => en remove_field => [ "logdate" ]