Kibana version: 6.7.0
Elasticsearch version: 6.7.0
Original install method (e.g. download page, yum, from source, etc.): docker
Information about experience and what I am trying to achive: I do not have a lot of experience with kibana and elasticsearch(I am using the free version) I tried to explore by myself couple of weeks ago and I want to make a chart(time sires) that show information the behavior of some sensors information and mark when the behavior(error is different from 0 with other color red or blue or whatever) . I tried some examples and are listed below but they do not fetch any data I assume that the mapping(jsons) are not well mapped,fetched from elasticsearch and it doesn't recognize the fields inside.
Description of the problem including expected versus actual behavior: I am trying to plot a simple graph and it doesn't work I checked weather the query received anything(trough kibana dev tools) and I have 1000 hits but the vega is not visualizing the data in any kind of way.
The query that I am using
GET /sensor1/_search
{
"query": {
"range": {
"timestamp": {
"gte": "now-2h/d",
"lte": "now"
}
}
}
}
The information that I am getting from the query
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : 1000,
"max_score" : 1.0,
"hits" : [
{
"_index" : "sensor1",
"_type" : "senzors",
"_id" : "PqBpTmoB-pKjklVPdAh5",
"_score" : 1.0,
"_source" : {
"name" : "sensor1",
"value" : 60.159078035304404,
"timestamp" : 1556093741100,
"error" : 2
}
},
{
"_index" : "sensor1",
"_type" : "senzors",
"_id" : "P6BpTmoB-pKjklVPdQgs",
"_score" : 1.0,
"_source" : {
"name" : "sensor1",
"value" : 44.50831755380234,
"timestamp" : 1556093742100,
"error" : 0
}
},
{
"_index" : "sensor1",
"_type" : "senzors",
"_id" : "JaBpTmoB-pKjklVPXAiU",
"_score" : 1.0,
"_source" : {
"name" : "sensor1",
"value" : 52.276283539084275,
"timestamp" : 1556093716100,
"error" : 0
}
},
{
"_index" : "sensor1",
"_type" : "senzors",
"_id" : "J6BpTmoB-pKjklVPXggT",
"_score" : 1.0,
"_source" : {
"name" : "sensor1",
"value" : 51.14213869391457,
"timestamp" : 1556093718100,
"error" : 0
}
},
{
"_index" : "sensor1",
"_type" : "senzors",
"_id" : "MaBpTmoB-pKjklVPZwiV",
"_score" : 1.0,
"_source" : {
"name" : "sensor1",
"value" : 51.35897156641911,
"timestamp" : 1556093728100,
"error" : 0
}
},
{
"_index" : "sensor1",
"_type" : "senzors",
"_id" : "MqBpTmoB-pKjklVPaAiE",
"_score" : 1.0,
"_source" : {
"name" : "sensor1",
"value" : 43.56251945502473,
"timestamp" : 1556093729100,
"error" : 0
}
},
{
"_index" : "sensor1",
"_type" : "senzors",
"_id" : "KaBpTmoB-pKjklVPXwi7",
"_score" : 1.0,
"_source" : {
"name" : "sensor1",
"value" : 38.130592033017045,
"timestamp" : 1556093720100,
"error" : 1
}
},
{
"_index" : "sensor1",
"_type" : "senzors",
"_id" : "IqBpTmoB-pKjklVPWQiE",
"_score" : 1.0,
"_source" : {
"name" : "sensor1",
"value" : 48.72730714815431,
"timestamp" : 1556093713100,
"error" : 0
}
},
{
"_index" : "sensor1",
"_type" : "senzors",
"_id" : "L6BpTmoB-pKjklVPZQix",
"_score" : 1.0,
"_source" : {
"name" : "sensor1",
"value" : 48.49622373903401,
"timestamp" : 1556093726100,
"error" : 0
}
},
{
"_index" : "sensor1",
"_type" : "senzors",
"_id" : "NKBpTmoB-pKjklVPagjf",
"_score" : 1.0,
"_source" : {
"name" : "sensor1",
"value" : 54.35314216737571,
"timestamp" : 1556093731100,
"error" : 0
}
}
]
}
}
The code I am Trying to pass to Vega
It does not fail but it doesn't print any information
{
"$schema": "https://vega.github.io/schema/vega/v3.json",
"title": "Event counts from all indexes",
"data": {
"url": {
"index": "sensor1",
"body": {
"query": {
"range": {
"timestamp": {
"gte": "now-2h/d",
"lte": "now"
}
}
},
"aggs": {
"hist": {
"date_histogram": {
"field": "@timestamp",
"interval": "3m",
"extended_bounds": {
"min": {"%timefilter%": "min"},
"max": {"%timefilter%": "max"}
},
"min_doc_count": 0
}
}
},
"size": 0
}
},
"format": {"property": "aggregations.hist.buckets"}
},
"mark": "line",
"encoding": {
"x": {
"field": "key",
"type": "temporal",
"axis": {"title": "Time"}
},
"y": {
"field": "error",
"type": "temporal",
"axis": {"title": "Document count"}
}
}
}
Simpler code for Vega that doesn't work eather
{
"$schema": "https://vega.github.io/schema/vega/v3.json",
"title": "Event counts from all indexes",
"data": {
"url": {
"index": "sensor1",
"body": {
"query": {
"range": {
"timestamp": {
"gte": "now-2h/d",
"lte": "now"
}
}
}
}
}
},
"mark": "line",
"encoding": {
"x": {
"field": "key",
"type": "temporal",
"axis": {"title": "Time"}
},
"y": {
"field": "value",
"type": "temporal",
"axis": {"title": "Document count"}
}
}
}
P.S. if someone can send me a few examples that are done with Vega or Vega-lite and Kibana and ElasticSearch (that use other fields except doc_count)