How to process logs from certain period of time? (I use elasticsearch input plugin)

There is an example of testing the age of an event here.