ENTRY

"Clean up elasticsearch with curator. Installation and simple step-by step"

Date:November 22nd, 2014
Tags:
Comments: 2
  • Join date: 11-30-99
  • Posts: 23
View Counter:
  • 1,484 views
Rate it
Ad
Poll
  • Best general purpose programming language is?

    View Results

    Loading ... Loading ...
Feeds:
  • bodytext bodytext bodytext
“Curator” is a small python based tool which can easily clean old data from elasticsearch

Here is a very simple way to remove old elastic search entries, based on timestamp.

Woks for:

✔ RHEL Linux 6.6

Should also work for:

✔ Any current RHEL based Linux like CentOs or Fedora

✔ Most mainstream Linux distros like Debean or Ubuntu

In short … this will install curator and remove all entries from local elasticsearch older than 1 day.
Please dont execute all 3 lines until you are sure you want the entries gone.

> yum -y install python-pip
> pip install elasticsearch-curator
> curator delete --older-than -1

Step by step

1

Get python package manager pip

> yum -y install python-pip
> pip --version
pip 1.3.1 from /usr/lib/python2.6/site-packages (python 2.6)

2

Get elasticsearch curator

> pip install elasticsearch-curator
> curator --version
curator 2.0.2

3

Clean local elasticsearch

I wrote small bash for it

> cat clear_es.bash
#!/bin/sh

curator delete --older-than -1

Just do ./clear_es.bash to remove all but last day’s entries

4

More ways to clean elastic search

You can connect curator to host and port other than default and tune time from which things must be preserved

--host localhost
--port 9200
-t (or --timeout) 30
-T (or --time-unit) days
-p (or --prefix) logstash-

Lot more here https://github.com/elastic/curator/wiki.

Have fun!

Be Sociable, Share!
 
Interesting entry?
VN:F [1.8.5_1061]
Rating: +2 (from 4 votes)
3 votes 'YES'  1 votes 'NO'


TAGS

RELATED
Pages
Posts

SOCIAL
Be Sociable, Share!

INCOMING SEARCH TERMS



Responces

2 Responses to “Clean up elasticsearch with curator. Installation and simple step-by step”

  1. Gearoid Gman says:

    Hey
    the link for Wiki is dead, here is the new link if you would like to update for others.

    https://github.com/elastic/curator/wiki

    Keep up the good work

    G

Leave a Reply