I can easily do a 'between' @timestamp filter for either a saved search or Kibana Visualization in order to display data from a constantly updating index (via Logstash) for a time period within the past (say) 34 seconds.
How do I set up a similar filter for a Vega visualization that is also displaying data from a constantly updating index?
The mgpnlquery* index is being refreshed every 30 seconds. How can I adjust the following data input section for the visualization to only accept data for the the past 34 seconds?
"data": [
{
"name": "sp500",
url: {
# The %-enclosed keys are handled by Kibana to modify the query
# before it gets sent to Elasticsearch. Context is the search
# filter as shown above the dashboard. Timefield uses the value
# of the time picker from the upper right corner.
%context%: true
%timefield%: @timestamp
index: mgpnlquery*
body: {
size: 1000
_source: ["@timestamp", "price", "account", "acctype", "region" ]
}
}
"format": { "property": "hits.hits" }
},
I solved this issue with the following range query:
"data": [
{
"name": "sp500",
url: {
# The %-enclosed keys are handled by Kibana to modify the query
# before it gets sent to Elasticsearch. Context is the search
# filter as shown above the dashboard. Timefield uses the value
# of the time picker from the upper right corner.
# %context%: true
# %timefield%: @timestamp
index: mgpnlquery*
body: {
size: 1000
_source: ["@timestamp", "price", "account", "acctype", "region" ]
"query": {
"range" : {
"@timestamp" : {
"gte" : "now-34s",
"lt" : "now"
}
}
}
}
}
"format": { "property": "hits.hits" }
},
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.