2016-10-04 127 views
0

我只在elasticsearch中有一個索引,名稱爲aa-bb-YYYY-MM。 此索引中的文檔包含一個我想用作日期字段的字段。 這些文檔已從自定義腳本插入(不使用logstash)。Kibana創建索引模式:通配符的奇怪行爲

當創建在kibana索引模式:

  1. 如果我進入AA-BB- *,日期字段沒有找到。
  2. 如果我輸入aa- *,則找不到日期字段。
  3. 如果我輸入aa *,則找到日期字段,並且可以創建索引模式。

但我真的需要按前兩個「維度」對索引進行分組。我試着用「_」代替「 - 」,結果相同。

有什麼想法發生了什麼?

回答

0

它爲我工作。我正在5.0版本分支上發佈最新版本(剛過beta1版本)。我不知道你在用什麼版本。

我創建此索引並添加了2個文檔;

curl --basic -XPUT 'http://elastic:[email protected]:9200/aa-bb-2016-09' -d '{ 
     "settings" : { 
      "number_of_shards" : 1 
     }, 
     "mappings" : { 
      "test" : { 
       "properties" : { 
        "date" : { "type" : "date"}, 
        "action" : { 
         "type" : "text", 
         "analyzer" : "standard", 
         "fields": { 
         "raw" : { "type" : "text", "index" : "not_analyzed" } 
         } 
        }, 
        "myid" : { "type" : "integer"} 
       } 
      } 
     } 
    }' 


curl -XPUT 'http://elastic:[email protected]:9200/aa-bb-2016-09/test/1' -d '{ 
     "date" : "2015-08-23T00:01:00", 
     "action" : "start", 
     "myid" : 1 
    }' 

curl -XPUT 'http://elastic:[email protected]:9200/aa-bb-2016-09/test/2' -d '{ 
     "date" : "2015-08-23T14:02:30", 
     "action" : "stop", 
     "myid" : 1 
    }' 

,我能夠與aa-bb-* enter image description here

創建索引模式