I am using ElasticSearch with LogStash. I am looking to query the unique
ips for a given period. (BTW, via Ruby and Tire)
My thought is to use a faceted search of IP Address and count the IPs, with
no fields. Many other ideas?
Here is the query I am using.
curl -X GET
"http://lcoalhost:9200/logstash-2012.12.02/apache_access/_search?pretty=true"
-d '{"facets":{"myfacet":{"terms":
{"field":"@fields.client_ip","size":999999,"all_terms":"false"}}},"fields":[""]}'
A few questions:
- Is the a means in ElasticSearch to query for a count of facets? I am
now just doing a ".size" of the "terms".
1b) There is a "special field" called "_index" that will return a facet
count of hits per index. Facet count or hits? How do I return this field?
(see:
http://www.elasticsearch.org/guide/reference/api/search/facets/terms-facet.html)
- Other specifying the size of the facet, is there a means to return all
terms. -1 and 0 do not work.
Thanks!
--