2015-10-14 117 views
1

我已經設置了elasticsearch(版本1.7.3)和Kibana(版本4.1.2),用於索引我們的應用程序的Elmah XML文件錯誤。我使用.Net來解析xml文件和Nest ElasticSearch客戶端以將索引插入到ElasticSearch中。問題是Kibana在「發現」標籤中沒有顯示任何數據。Kibana在「發現」選項卡中不顯示任何結果

當我運行curl -XGET localhost:9200/.kibana/index-pattern/eol?命令時,我得到如下回應:

{"_index":".kibana","_type":"index-pattern","_id":"eol","_version":2,"found":tru 
e,"_source":{"title":"eol","timeFieldName":"errorTime","fields":"[{\"name\":\"_i 
ndex\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"an 
alyzed\":false,\"doc_values\":false},{\"name\":\"filePath\",\"type\":\"string\", 
\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\" 
:false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\ 
"indexed\":true,\"analyzed\":false,\"doc_values\":false},{\"name\":\"message\",\ 
"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\": 
true,\"doc_values\":false},{\"name\":\"errorTime\",\"type\":\"date\",\"count\":0 
,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":false},{\ 
"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"indexe 
d\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_id\",\"type\":\" 
string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"d 
oc_values\":false}]"}} 

現狀 Elasticsearch啓動和運行,響應API直接Elasticsearch執行查詢像http://localhost:9200/eol/_search?q= *返回大量結果

enter image description here

Kibana的正在運行,甚至發現由Elasticsearch公開的「eol」索引 Kibana也顯示「eol」文檔的正確屬性和數據類型 「Discover」選項卡不顯示任何結果......偶數當設置時間段爲幾年... 我已經嘗試從設置選項卡刪除索引,重新啓動Kibana,然後重新添加設置索引。 我也嘗試使用yyyy-MM-ddThh:mm:ss格式保存日期字段,但我仍然沒有看到任何結果。 我認爲這個問題與Elmah UTC日期格式(例如2015-10-13T19:54:49.4547709Z)或Elmah消息有關。我猜ElasticSearch喜歡Elmah的消息,但Kibana沒有。

任何想法??

這裏的Kibana如何看待 「EOL」 指數: enter image description here

..和我所看到的在發現標籤: enter image description here enter image description here

+0

這可能是時間問題。你可以採取像「過去5年」,看看是否有任何結果。 –

+0

@VineethMohan:當我搜索最近12小時時,kibana沒有顯示任何內容。我目前正在運行最近5年的搜索。 –

+0

@VineethMohan:如果我搜索過去5年未找到任何數據。 –

回答

0

我用鳥巢將數據插入到ElasticSearch。 Nest似乎序列化List並向ElasticSearch發出請求的方式似乎有Kibana不喜歡的特殊字符。

之前(不工作):

private static void WriteErrorsIntoElasticSearchIndex(ElasticClient elasticClient, List<error> errors) 
     { 
       elasticClient.Index(errors);  
     } 

後(工作):

private static void WriteErrorsIntoElasticSearchIndex(ElasticClient elasticClient, List<error> errors) 
     { 
      foreach (var error in errors) 
      { 
       elasticClient.Index(error);  
      } 
     } 
+0

Btw。你可以嘗試'elasticClient.IndexMany(錯誤)'。 – Rob

+0

感謝羅布,我確實發現了那個財產,但很匆忙。我會測試並讓社區知道。 –

0

你有 「\」,通常在elasticsearch結果沒有,JSON不能解析結果,因爲它不合適,

相關問題