Skip to content

Instantly share code, notes, and snippets.

@panchicore
Created July 18, 2017 07:23
Show Gist options
  • Save panchicore/b7b32c3a057aa85b66618040c9920cfd to your computer and use it in GitHub Desktop.
Save panchicore/b7b32c3a057aa85b66618040c9920cfd to your computer and use it in GitHub Desktop.
Scripted fields

My Scripted Fields with Kibana

Dates

Get the year

doc['incident_date'].date.year

Calculating difference in days between 2 dates

(doc['report_date'].date.getMillis() - doc['incident_date'].date.getMillis()) / 1000 / 60 / 60 / 24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment