{"id":21479374,"url":"https://github.com/rycus86/elasticsearch-cleaner","last_synced_at":"2025-03-17T08:42:23.112Z","repository":{"id":66144719,"uuid":"125129007","full_name":"rycus86/elasticsearch-cleaner","owner":"rycus86","description":"Simple Go application to clean old indices from Elasticsearch","archived":false,"fork":false,"pushed_at":"2018-04-18T07:13:44.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-23T18:16:09.007Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rycus86.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-13T23:46:49.000Z","updated_at":"2020-06-17T12:44:51.000Z","dependencies_parsed_at":"2023-02-21T16:45:21.373Z","dependency_job_id":null,"html_url":"https://github.com/rycus86/elasticsearch-cleaner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Felasticsearch-cleaner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Felasticsearch-cleaner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Felasticsearch-cleaner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Felasticsearch-cleaner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rycus86","download_url":"https://codeload.github.com/rycus86/elasticsearch-cleaner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244004246,"owners_count":20382354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T11:24:59.434Z","updated_at":"2025-03-17T08:42:23.060Z","avatar_url":"https://github.com/rycus86.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elasticsearch index cleaner\n\nSmall Go application to clear old Elasticsearch indices.\n\n## Motivation\n\nAs descibed [on my blog](https://blog.viktoradam.net/2018/02/06/home-lab-part5-monitoring-madness/#logging), if I want to keep only a certain amount of logs collected into Elasticsearch, I need to periodically delete the old indices that correspond to days too far in the past. This can be done manually with a simple `curl` command.\n\n```shell\n$ curl -X DELETE http://elasticsearch:9200/fluentd-20180412\n```\n\n## Usage\n\nThe application is available on [Docker Hub](https://hub.docker.com/r/rycus86/elasticsearch-cleaner/), and to run it, you can:\n\n```shell\ndocker run --rm -it \\\n\t-e BASE_URL=http://elasticsearch:9200 \t\\\n\t-e PATTERN=logstash-.* \t\t\t\\\n\t-e MAX_INDICES=14 \t\t\t\\\n\t-e INTERVAL=12h \t\t\t\\\n\t-e TIMEOUT=30s \t\t\t\t\\\n\trycus86/elasticsearch-cleaner\n```\n\nThe available environment variables for the configuration are:\n\n- __BASE_URL__: The URL of the Elasticsearch server\n- __PATTERN__: The regular expression to look for matching indices to delete\n- __MAX_INDICES__: The number of (matching) indices to keep *(default: 20)*\n- __INTERVAL__: The interval between checking for old indices *(default: 12h)*\n- __TIMEOUT__: The timeout for HTTP calls to the Elasticsearch server *(default: 30s)*\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frycus86%2Felasticsearch-cleaner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frycus86%2Felasticsearch-cleaner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frycus86%2Felasticsearch-cleaner/lists"}