What is the Curator?¶
Curator is a tool that allows you to take regular/scheduled actions against the indices in your cluster, based on pre-defined filters. At ObjectRocket, we’ve integrated Curator into our service so you can configure it via the UI and let us handle the day to day maintenance and execution of Curator itself.
Curator functions generally consist of actions to perform and filters to determine which index(es) to take action against. Today the actions that we support on ObjectRocket are:
- Delete: Delete the indices that match the specified filters
- Close: Close the indices that match the specified filters
- Alias: Add and/or remove indices from an alias that match the specified filters. This feature is currently available via Early Access
- Create: Create a new index. Today, this must follow a Delete/Close action.
Curator Task options¶
Once you select your Elasticsearch instance from the ObjectRocket UI and select ‘Add Task’ under the Curator section, you’ll be presented with the following fields:
Task Name: The name for the task. This is a required field and just a description of what this task will do.
Task Type: You can select to Delete the indices which match the filters, or Close them to writes and queries. This is a required field.
Filters: The filters will allow you to narrow down which indices are affected by Curator
- Add / Remove: When the Alias Task Type is selected, you can specify separate filters for the indices you’d like to add to the alias and the indices you’d like to remove from the alias.
- Filter by age: Allows you to set a filter based on the age of the index. The age is based on the creation date of the index.
- Filter by name: Allows you to set a filter based on the naming convention or RegEx.
Schedule: Determines how often to run Curator. The default is every 5 minutes, but tasks can also be scheduled to run at specific times.
Create a new index…: If a Close or Delete event occurs, you have the option of creating a new index based on the name pattern provided.
You are required to select at least one of the filters and if both are selected, action will only be taken against indices that match BOTH filters.
How often are the tasks run?¶
By default each task is run at least once every 5 minutes. If there are no indices returned by the filters, no action is performed.
There is also an option to set a schedule to run Curator tasks at a specific time, such as:
- Every hour at the specified minute
- Every day at the specified time
- Every week at the specified day and time
- Every month on the specified day and time. If you select day 31, that task will run on the last day of the month in shorter months.
For this Tutorial, the scenario is an environment where you would like to maintain an alias for the indices covering only the last 7 days. This example will use the Alias action in Curator to maintain the alias.
First, start at the instance details page for the cluster we want to add an Alias Curator task for and select the “Curator” tab:
As you can see in the image above, there are already a couple of Curator tasks. Create another and this time it’ll be an “alias” Curator task. To do this, select “Add Task”:
Now, you can select the “Alias” task type. After naming our task (I went with “lastSevenDays Alias”), we need to specify the alias name (“lastSevenDays” for this example). You can also see that we have a couple of options: “Add” and “Remove”. These are to allow you to specify filters for the indices that you wish to add or remove from the alias. for lastSevenDays we’re going to want to add some indices and remove others. So, let’s select both:
The desired filters will add all the indices that are newer than 7 days and remove those that are older than 7 days, which, once filled in, would look like the following:
We can leave it at the default interval (every 5 minutes) to specify that we want this task to run pretty regularly to keep our alias up-to-date. We can go ahead and select “Save Task” and that’s it! Now the task will run every 5 minutes to keep the Elasticsearch Alias updated.