问题
I have setup elasticsearch(version 1.7.3) and Kibana(version 4.1.2) for indexing our application's Elmah XML files errors. I am using .Net to parse the xml files and Nest ElasticSearch client to insert the indexes into ElasticSearch. The issue is that Kibana doesn't display any data in the "Discover" tab.
When I run curl -XGET localhost:9200/.kibana/index-pattern/eol? command, I get the following response:
{"_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}]"}}
Current situation Elasticsearch is up and running, responds to API executing a query directly on Elasticsearch like http://localhost:9200/eol/_search?q=* returns lots of results
Kibana is up and running, even finds the "eol" index exposed by Elasticsearch Kibana also shows the correct properties and data type of the "eol" documents "Discover" tab doesn't show any results...even when setting the time period to a couple of years... I have tried Delete the index from the Settings tab, restart Kibana, then re-adding index in Settings. I have also tried to save the date field with a yyyy-MM-ddThh:mm:ss format but I still do not see any results. I believe the issue is with either the Elmah UTC date format(An example is 2015-10-13T19:54:49.4547709Z) or the Elmah message. I guess ElasticSearch likes the Elmah message but Kibana does not.
Any ideas??
Here's how Kibana sees the "eol" index:
..and what I see in the discover tab:
回答1:
I was using Nest to insert data into ElasticSearch. It seems that the way Nest is serializing a List and making a request to ElasticSearch has special characters that Kibana does not like.
Before(Not working):
private static void WriteErrorsIntoElasticSearchIndex(ElasticClient elasticClient, List<error> errors)
{
elasticClient.Index(errors);
}
After(working):
private static void WriteErrorsIntoElasticSearchIndex(ElasticClient elasticClient, List<error> errors)
{
foreach (var error in errors)
{
elasticClient.Index(error);
}
}
回答2:
you have "\" , normally in elasticsearch result there is not, JSON can not parse the result because it is not appropriate,
来源:https://stackoverflow.com/questions/33135772/kibana-doesnt-show-any-results-in-discover-tab