How to delete only last day's data in Elasticsearch?


#1

Hello,

How do I delete only last day's data in Elasticsearch ?

Thanks


(Magnus Bäck) #2

Are you using timeseries indexes, i.e. indexes named xxx-2016.01.12 or similar?


#3

Hi,

Unfortunatly not.


(David Pilato) #4

If you don't have any timestamp in your data, then you can't.
If you have, you can add the delete-by-query plugin.

But you should prefer using time based indices.


(Magnus Bäck) #5

In that case you can use the delete by query API, which is deprecated but available via a plugin in 2.0. If this is something you'll be doing often you should look into timeseries indexes.


(system) #6