And my vega code of x-axis (@timestamp) on this chart is the following:
"encoding": {
"x": {
"field": "_source.@timestamp",
"type": "temporal",
"axis": { "title": "Timeline", "format": " %d %b %a %H:%M:%S" }
}
I am not sure that vega code may cause time range not work or not.
my version : 7.5.1
Could anyone can help me with this issue.
However, I edited the vega code by your reference as the following:
"data":{
"url": {
"index": "test",
"%context%": true,
"%timefield%": "@timestamp",
"body": {
// When aggegating, do not return individual documents that match the query
"size": 100,
// Data aggegation...
"aggs": {
// Name of the aggegation - your Vega graph will use it to parse the results
"hist": {
"date_histogram": {
"field": "@timestamp",
// interval value will depend on the daterange picker
// Use an integer to set approximate bucket count
"interval": {"%autointerval%": true},
// Make sure we get an entire range, even if it has no data
"extended_bounds": {
"min": {"%timefilter%": "min"},
"max": {"%timefilter%": "max"}
},
// Use this for linear (e.g. line, area) graphs
// Without it, empty buckets will not show up
"min_doc_count": 0
}
}
}
}
},
"format": {"property": "hits.hits"}
}
(exactly the same as your current spec, just adding the%timefield% property, so Kibana knows what filter to add for your time range).
Also make sure your test index actually contains data for the range you configured in the time picker and that your time field is actually called @timestamp.
If that doesn't work, please follow the steps in the gist I linked above and post the results here, otherwise I'm not able to help you. It makes also sense to post an example document of yours to make sure it has the shape your vega spec expects.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.