Registry / database / elasticsearch-curator

elasticsearch-curator

JSON →
library9.0.0pypypi✓ verified 86d ago

Elasticsearch Curator is a tool designed to manage Elasticsearch indices and snapshots programmatically via YAML configuration files. It simplifies tasks like deleting old indices, optimizing shards, or closing/opening indices. Currently at version 9.0.0, it follows an active release cadence, with major releases aligning with Elasticsearch versions and frequent patch releases for bug fixes and minor features.

pip install elasticsearch-curator
INSTALL
IMPORT
SIG · ELASTICSEARCH-CURA
E
elasticsearch-curator
databasepythonv9.0.0
Install
3.8s avg
Import
1375ms
Disk
48MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v9.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 1.426s · 52.5MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.8s · import 1.323s · 53MB
48MB installed
● package 48MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

curator
import curator
While `curator` can be imported, it's primarily designed as a command-line tool. Direct programmatic use is possible via `curator.api` but less common for full lifecycle management.
cli
from curator import cli
Allows advanced users to programmatically invoke Curator's CLI functions, though `subprocess` is typically preferred for invoking the `curator` command.

The primary way to use Elasticsearch Curator is via its command-line interface with YAML configuration files for client settings and actions. This quickstart demonstrates how to check the installed version and simulate an action in dry-run mode using Python's `subprocess` module, which is common for interacting with CLI tools.

import subprocess import os # Most common usage is via CLI with configuration files. # Example: Create a dummy action file and run curator in dry-run. # Create a dummy action configuration file action_config_content = """ actions: 1: action: delete_indices description: "Delete indices older than 30 days matching 'logstash-'" options: ignore_empty_list: True timeout_override: continue_if_exception: False disable_action: False dry_run: True # Always set dry_run in example code for safety filters: - filtertype: pattern kind: prefix value: logstash- - filtertype: age source: name direction: older unit: days unit_count: 30 """ action_file_path = "curator_action.yml" with open(action_file_path, "w") as f: f.write(action_config_content) try: # Get Curator version to check installation print("Checking Curator version:") version_result = subprocess.run( ["curator", "--version"], capture_output=True, text=True, check=True ) print(version_result.stdout.strip()) # Simulate running an action in dry-run mode print("\nSimulating an index deletion action (dry-run):") # Note: A client configuration is typically also needed in a separate file, # or specified via CLI arguments like --host, --port etc. # For simplicity, this example assumes default client config or # that ES is running on localhost:9200 and no auth is needed. # For a real run, create a 'curator.yml' client config file or pass # client options directly. dry_run_result = subprocess.run( ["curator", "--host", "localhost", "--port", "9200", action_file_path, "--dry-run"], capture_output=True, text=True, check=True ) print(dry_run_result.stdout) if dry_run_result.stderr: print("STDERR:", dry_run_result.stderr) except FileNotFoundError: print("Error: 'curator' command not found. Is elasticsearch-curator installed?") except subprocess.CalledProcessError as e: print(f"Curator command failed with exit code {e.returncode}") print(f"STDOUT: {e.stdout}") print(f"STDERR: {e.stderr}") finally: if os.path.exists(action_file_path): os.remove(action_file_path) print("\nThis demonstrates how to run a Curator action in dry-run mode.") print("For actual index management, remove '--dry-run' and ensure Elasticsearch is running.") print("Refer to official documentation for full client and action configuration.")
curator --version
Debug
Known issues
breakingCurator 9.x requires Python 3.10 or later. Python 3.8 and 3.9 are no longer supported.
fix
Upgrade your Python environment to 3.10, 3.11, 3.12, or 3.13 before installing Curator 9.x.
affects: 9.0.0 and later
breakingCurator 9.x exclusively supports Elasticsearch 9.x. It is not compatible with Elasticsearch 8.x or older versions.
fix
If you need to manage Elasticsearch 8.x clusters, use Curator 8.0.21 or an earlier 8.x release. Do not upgrade to Curator 9.x for ES 8.x clusters.
affects: 9.0.0 and later
gotchaA critical bug in Curator 8.0.17 (and earlier 8.x versions) with the `age` filter could erroneously delete indices that did not match the `timestring` pattern, leading to unintended data loss.
fix
Upgrade to Curator 8.0.18 or later. Always use `--dry-run` to review planned actions before executing them on live clusters.
affects: 8.0.0 - 8.0.17
gotchaThe `--ignore_empty_list` option was not respected in Curator 8.0.20 and earlier, potentially causing actions to fail if no indices matched the filters.
fix
Upgrade to Curator 8.0.21 or later to ensure `--ignore_empty_list` is correctly honored in all singletons.
affects: 8.0.0 - 8.0.20
gotchaIn Curator 8.0.13, default values from command-line options could incorrectly override settings defined in configuration files due to an `es_client` bug.
fix
Upgrade to Curator 8.0.14 or later, which includes `es_client==8.12.9` correcting this behavior. Always verify your configuration with `--dry-run`.
affects: 8.0.13
gotchaCurator is primarily a command-line interface (CLI) application. While a Python API exists, programmatic use as a library is not its main design goal and might require more complex setup than intended.
fix
For most use cases, generate YAML configuration files and invoke `curator` via `subprocess` from your Python application. Refer to the official documentation for CLI usage.
affects: All versions
Errors
Common errors & fixes
RuntimeError: Python 3.8 and 3.9 are no longer supported. Please upgrade to Python 3.10 or later.
Attempting to run Curator 9.x on an unsupported Python version.
fix
Upgrade your Python environment to 3.10, 3.11, 3.12, or 3.13. Alternatively, install Curator 8.x (`pip install 'elasticsearch-curator<9'`) if you must use an older Python.
elasticsearch.exceptions.UnsupportedProductError: The client noticed that the server is not Elasticsearch and is not supported by this client version.
Curator 9.x is attempting to connect to an Elasticsearch 8.x cluster, which is incompatible.
fix
If managing Elasticsearch 9.x, ensure your `client` configuration points to an ES 9.x cluster. If managing ES 8.x, downgrade Curator to 8.0.21 or an earlier 8.x version using `pip install 'elasticsearch-curator<9'`.
curator.exceptions.ConfigurationError: Missing a required setting. Check your configuration file.
Your YAML configuration file for Curator (client or action) is malformed, missing required keys, or contains invalid values.
fix
Review your `curator.yml` (client config) and action YAML files against the official Curator documentation. Ensure proper YAML syntax and that all mandatory fields are present and correctly formatted.
bash: curator: command not found
The `curator` executable is not in your system's PATH, or `elasticsearch-curator` was not installed correctly.
fix
Ensure `pip install elasticsearch-curator` completed successfully. If installed in a virtual environment, activate it. If using `pipx`, ensure `curator` is added to your path. You might also need to ensure your `~/.local/bin` is in your PATH.
Upgrade
Version history
9.0.0latest on PyPI · released Oct 3, 2025
Audit
Dependencies
es_clientrequiredOfficial Elasticsearch Python client wrapper, used internally for all API interactions.
PyYAMLrequiredUsed for parsing and processing the YAML configuration and action files.
ClickrequiredUsed for building the command-line interface.
Agent activity
7 hits · last 30 days
node
6
Resources
elasticsearch-curator — pip install elasticsearch-curator · libregistry