Visualization Based on Current Date

Good day, team!

I'm pretty new on Elastic stuff and would like to know if there is a way to create a visualization which shows a date field.

If this field contains the current date, then set the background to green. Otherwise, set the background to red.

Is that possible?

Thanks in advance.

Not sure if TSVB can do that because you need to compare dates to find if it's todays date or not.

But you can do this in Vega. Sorry to say there are no examples of this that I know of.

A quick guide on what you would need to do is...

  1. Query the index to return the date.
  2. Get current date with now().
  3. Compare dates to see if the date is current.
  4. Create a Text Mark to show the date.
  5. Conditionally color background based on step 3.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.