From 11b26d4ad6c96c6738e20d17823f640bd3d7f5a5 Mon Sep 17 00:00:00 2001 From: Wang Jian Date: Sun, 20 Apr 2014 00:12:29 +0800 Subject: [PATCH] Workaround for non-UTC indexes Indexes of elasticsearch are supposed to be in UTC, but at least, rsyslog can only use local time to generate index name. Kibana first finds indexes to query based on UTC time. So for east timezone, there are a few hours, kibana will miss new created index(es) and no new data is displayed during these hours. This patch workarounds this issue. In most cases, there should be no indexes for future time, so this just works without any harm. Even if indexes for future time do exist, the real search query will limit time range before now. --- src/app/services/kbnIndex.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/services/kbnIndex.js b/src/app/services/kbnIndex.js index 8dbdb8534030d..e693304742423 100644 --- a/src/app/services/kbnIndex.js +++ b/src/app/services/kbnIndex.js @@ -83,6 +83,10 @@ function (angular, _, config, moment) { if(_.contains(['hour','day','week','month','year'],interval)) { var range; start = moment(start).clone(); + // In case indexes are created in local timezone viewpoint, e.g. rsyslog's + // omelasticsearch output module. + // This adjustment covers all timezones and should be harmless. + end = moment(end).clone().add('hours',12); range = []; while (start.isBefore(end)) { range.push(start.clone());