elasticsearchkibanatimelion

How to get doc in a time range for a week


I'm trying to get all documents of the week but in the time range of 10 am to 2 pm for example, is there a way to do it in Lucene, because I have to put this query into a timelion.


Solution

  • if I am right what you are trying to do is to plot 7 days of the week but only for 10 am to 2 pm. If there is a way to manipulate your data a little then follow the following steps:

    1. Add an extra column to your data stating appropriate header to the column.

    2.Before pushing the data into elastic index use a job/script to mark all the time ranges between 2 to 10 with a "1" and all other timestamps as "0"

    1. Now in your timelion query plot the docs from the weekly data only if the column has value "1".So basically we add our own filter and that's the only workaround to get the work done.