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

Hello,

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

Thanks

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

Hi,

Unfortunatly not.

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.

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.