[[older-than]]
== --older-than


[float]
Summary
~~~~~~~

IMPORTANT: This flag only functions within the scope of <<index-selection,index selection>> or <<snapshot-selection,snapshot selection>>.

Filter indices "older than" a given number of <<time-unit,time-units>>. The
indices must also have a <<timestring>>.

The value provided indicates a given number of <<time-unit,time-units>> ago to
use as a reference point. All indices "older than" that point will be included.

[float]
Flags
~~~~~

* `--older-than` Include only indices older than _n_ <<time-unit,time-units>>
* <<time-unit,`--time-unit`>> Unit of time to reckon by. Can be one of `hours`,
`days`, `weeks`, or `months`
* <<timestring,`--timestring`>> http://strftime.org[Python strftime] string to
match your index definition. 2014.07.15 would be `%Y.%m.%d`

[float]
Example
~~~~~~~

Delete hourly Logstash indices older than 48 hours:

-----------------------------------------------------------------------------------------------------
curator delete indices --time-unit hours --older-than 48 --timestring '%Y.%m.%d.%H' --prefix logstash
-----------------------------------------------------------------------------------------------------
