Hello,
I’m trying to add text to my vega visualization that displays the selected Time Range. I started with what’s shown below, which gives the current time but I quickly reached a dead-end. Is there a built in signal that accesses the min and max timefilter?
Unfortunately there is no built-in signal like that (but that sounds like a good idea to implement it -- please create a ticket in https://github.com/elastic/kibana ) The only thing that Kibana Vega has is the ability to filter data based on the current timefilter.
As a possible workaround that I am not sure would work: in theory there might be a way to create an ElasticSearch query in such a way so it returns the same value as passed in, thus returning the current timefilter. Just a thought that I never really explored.
Alternatively you could call key instead which will be the time in UNIX time. After this, you need to just call your min and max as appropriate to show that in a text call. You should add a time filter too to display in proper format if using the key (in UNIX time) like "text": {"signal": "utcFormat(datum.min, '%x %X')"}.
Once done, all you need to do is add a from to the timegrabber data call and call the datum.min and datum.max respectively.
Could you explain what you mean by "you could call key instead"? I just realized that @timestamp is a string value which I'm having problems formatting into something a little easier to read. I'm pretty sure you gave me the answer in your last paragraph but I'm not tracking.
Sure, instead of calling key_as_string in the aggregate transform, use the "key" in the "fields": section. This will call the time as a UNIX timestamp instead of a string. So basically do this instead:
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.