Count total records in elasticsearch

Hi,

Is there a simple command-line to count total records in elasticsearch?

Thanks.

If you search, you'll find the link below... try to read the online document, it has a lot of info you need there...

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-count.html

Great!

Just beware, it can happen that count reaches the timeout, just so you know and are not so surprised by an unexpected place for the code to crash :slight_smile:

I have this going into collectd, graphite and sensu.

Any of the NaN's due to slow
count within the custom exec
collectd wakeup period for
curl's against the ES API
do not count against the cluster
unless I only get NaN's for a period.

The rest of the calculation is done with the derive option on the count in collectd to determine when there are drastic drops in cluster insertion rates.

A separate question: are there any tools which let one

a) retrieve logstash files in their
entirety in a given day's logstash
(not the index and all its
documents though that would be
the simple case)

b) permit deletion of arbitrary
data including individual logstash
stored files on a given day
(not the entire day though
that would be the simple case)

I do have curator enabled but it is just to keep a year's data, so when I want to go special-purpose cleaning I would like to have a tool beyond
API calls.

And not have to reinvent the wheel.