I'm trying to create a visualisation in Kibana dashboard that shows the UP Time of some API's and also shows when they last logged a response into Elastic. I want to colour each api's info green, amber or red, depending on when they last logged a response to elastic. How would I go about doing this?
I can only seem to get it to show the up time or last response time but not colour it or group it by time since the last response
Hi Thomas. I think you would need a formula in Lens like last_value(timestamp, kql='timestamp: *') and use the Color by value option. Here's an example screenshot.
Hi Thomas. Sadly, last_value does not work with Datetime fields in v7.17. I was testing on v8.8.2.
You could create a runtime field on your index pattern to convert the timestamp to a double of epoch milliseconds. Then use that field in your formula.
This is the script I used for a runtime field called timestamp_epoch.
ZonedDateTime input = doc['timestamp'].value;
long milliSinceEpoch = input.toInstant().toEpochMilli();
emit(milliSinceEpoch)
Then I can use the formula last_value(timestamp_epoch) in my Lens visualization.
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.