소스 검색

[elasticsearch] Do not set a placeholder to index name, if it's already specified.

stop-cran 7 년 전
부모
커밋
20214b3d6a
1개의 변경된 파일8개의 추가작업 그리고 4개의 파일을 삭제
  1. 8 4
      public/app/plugins/datasource/elasticsearch/config_ctrl.ts

+ 8 - 4
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';
+    }
   }
 }