From 496585c1f8d1c0d3ed3d47eb16784080f8a70a5f Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Mon, 3 Feb 2014 11:47:27 -0700 Subject: [PATCH] Support for multiple index patterns, closes #22 --- src/app/partials/dasheditor.html | 3 ++- src/app/services/kbnIndex.js | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/partials/dasheditor.html b/src/app/partials/dasheditor.html index a4d3771c2c6d8d..75b5bc98ee43d6 100644 --- a/src/app/partials/dasheditor.html +++ b/src/app/partials/dasheditor.html @@ -39,7 +39,8 @@
Index Settings
default logstash index pattern you might use [logstash-]YYYY.MM.DD. The [] in "[logstash-]" are important as they instruct Kibana not to treat those letters as a - pattern. + pattern. You may also specify multiple indices by seperating them with a comma(,). + For example [web-]YYYY.MM.DD,[mail-]YYYY.MM.DD Please also note that indices should rollover at midnight UTC.

diff --git a/src/app/services/kbnIndex.js b/src/app/services/kbnIndex.js index 76fba98ba9a960..83fda5cd66fff1 100644 --- a/src/app/services/kbnIndex.js +++ b/src/app/services/kbnIndex.js @@ -20,8 +20,13 @@ function (angular, _, config, moment) { return resolve_indices(possible).then(function(p) { // an extra intersection - var indices = _.intersection(possible,p); + var indices = _.uniq(_.flatten(_.map(possible,function(possibleIndex) { + return _.intersection(possibleIndex.split(','),p); + }))); + indices.reverse(); + console.log(indices); + return indices; }); };