How to get count for each type across all indexes


(Alexander Gray II) #1

I'm just getting my feet wet with ES and I'm using the Head Plugin to
examine my logstash messages coming in.

One thing we're interested in is finding the document count for each type.
I figured out how to get all Types:
curl -XGET 'http://localhost:9200/_mapping'

But now I want to cycle through all Types and get the total doc count
across all indexes.
I assume it's like:
curl -XGET 'http://localhost:9200/_all/[TYPE]/_search'

Is there a better way to do this?
Thanks!

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Alexander Reelsen) #2

Hey,

have you tried just executing

http://localhost:9200/_all/TYPE/_count - should do what you need, unless I
didnt have enough coffee (simply returns a count instead of search results).

--Alex

On Tue, Oct 1, 2013 at 2:59 AM, Alexander Gray II grayaii@gmail.com wrote:

I'm just getting my feet wet with ES and I'm using the Head Plugin to
examine my logstash messages coming in.

One thing we're interested in is finding the document count for each type.
I figured out how to get all Types:
curl -XGET 'http://localhost:9200/_mapping'

But now I want to cycle through all Types and get the total doc count
across all indexes.
I assume it's like:
curl -XGET 'http://localhost:9200/_all/[TYPE]/_search'

Is there a better way to do this?
Thanks!

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Alexander Gray II) #3

Awesome. Just making sure I was on the right track.
Thanks!
Alex

On Tuesday, October 1, 2013 3:40:20 AM UTC-4, Alexander Reelsen wrote:

Hey,

have you tried just executing

http://localhost:9200/_all/TYPE/_count - should do what you need, unless
I didnt have enough coffee (simply returns a count instead of search
results).

--Alex

On Tue, Oct 1, 2013 at 2:59 AM, Alexander Gray II <gra...@gmail.com<javascript:>

wrote:

I'm just getting my feet wet with ES and I'm using the Head Plugin to
examine my logstash messages coming in.

One thing we're interested in is finding the document count for each type.
I figured out how to get all Types:
curl -XGET 'http://localhost:9200/_mapping'

But now I want to cycle through all Types and get the total doc count
across all indexes.
I assume it's like:
curl -XGET 'http://localhost:9200/_all/[TYPE]/_search'

Is there a better way to do this?
Thanks!

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #4