Canvas display current date


I am looking to put the current date in to canvas for our reports, any ideas how i could do this?


1 Like


You can add Time filter element, from the list of elements.

Hi @majagrubic,

I am already filtering the report, i need to display the current date on the report.

Depending on the format of your data, you can use a Markdown widget and an ES query to fetch the latest timestamp from your documents. That would require that you have documents with today's date in your ES data.

You can then do something like this:

  1. Add a markdown (Text) widget
  2. Select Elasticsearch SQL as data source
  3. Open expression editor
  4. Write a SQL query along the lines of:
| essql 
  query="SELECT timestamp as CurrentDate FROM \"kibana_sample_data_flights\"
 ORDER BY timestamp DESC
| markdown "Current date is {{#each rows}}{{CurrentDate}}{{/each}}"
| render


Thats perfect, got that working