Canvas display current date

Hi,

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

Thanks

1 Like

Hi,

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:
filters
| essql 
  query="SELECT timestamp as CurrentDate FROM \"kibana_sample_data_flights\"
 ORDER BY timestamp DESC
 LIMIT 1"
| markdown "Current date is {{#each rows}}{{CurrentDate}}{{/each}}"
| render

@majagrubic

Thats perfect, got that working