From 20214b3d6aa6e7c0458229bf1e89be8a84cf5ea5 Mon Sep 17 00:00:00 2001 From: stop-cran Date: Wed, 14 Nov 2018 18:12:05 +0200 Subject: [PATCH] [elasticsearch] Do not set a placeholder to index name, if it's already specified. --- .../plugins/datasource/elasticsearch/config_ctrl.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/public/app/plugins/datasource/elasticsearch/config_ctrl.ts b/public/app/plugins/datasource/elasticsearch/config_ctrl.ts index 154ff9bcb91..fad3a6895ae 100644 --- a/public/app/plugins/datasource/elasticsearch/config_ctrl.ts +++ b/public/app/plugins/datasource/elasticsearch/config_ctrl.ts @@ -28,9 +28,13 @@ export class ElasticConfigCtrl { ]; indexPatternTypeChanged() { - const def = _.find(this.indexPatternTypes, { - value: this.current.jsonData.interval, - }); - this.current.database = def.example || 'es-index-name'; + if (!this.current.database || + this.current.database.length === 0 || + this.current.database.startsWith('[logstash-]')) { + const def = _.find(this.indexPatternTypes, { + value: this.current.jsonData.interval, + }); + this.current.database = def.example || 'es-index-name'; + } } }