Hello everyone,
I'm trying to create a graph with vega. A date histogram graph from an aggregation, but it is not working. In Kibana, it shows me the following error.
_.aggregations is undefined
Would you mind to make a look, and giving to me a suggestion.
The associated code is this:
{
$schema: https://vega.github.io/schema/vega-lite/v2.json
title: Daily Count
data: {
url: {
index: hs_index
body: {
size: 1000000,
// Just ask for the fields we actually need for visualization
_source: ["@timestamp","@version","consumed","consumed_text1","consumed_text2","free","free_text1","free_text2","host", "logLevel", "logdate","max","max_text1","max_text2","message","values","values_names","date_time","date_time","message"]
"track_total_hits": true,
"query": {
"match": {
"message": "COMMAND ORDER"
}
},
"aggregations":{
order_over_time:{
date_histogram: {
field: "date_time",
format: "yyyy-MM-dd hh:mm-ss",
interval: "day"
}
}
}
}
}
format: {property: "aggregations.order_over_time.buckets"}
}
mark: bar
encoding: {
x: {
field: key
type: temporal
axis: {title: false}
}
y: {
field: doc_count
type: quantitative
axis: {title: "Call count"}
}
}
}
Thanks so much,
JUAN DAVID BRICENO GUERRERO