# Summarizing Elasticsearch using Logstash

**URL:** <https://discuss.elastic.co/t/summarizing-elasticsearch-using-logstash/59669>\
**Category:** Logstash\
**Created:** [September 2, 2016, 1:23pm UTC](https://discuss.elastic.co/t/summarizing-elasticsearch-using-logstash/59669 "2016-09-02T13:23:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rjsteckel](https://avatars.discourse-cdn.com/v4/letter/r/e8c25b/32.png) [@rjsteckel](https://discuss.elastic.co/u/rjsteckel)\
**Post date:** [September 2, 2016, 1:23pm UTC](https://discuss.elastic.co/t/summarizing-elasticsearch-using-logstash/59669/1 "2016-09-02T13:23:54Z")

</div>

We're using postgres as our data warehouse and elasticsearch as our UI's datastore. We then use logstash with jdbc inputs to periodically update elasticsearch from postgres.

I would like to create a new index in elasticsearch that summarizes what is in both databases so that we know if things are in sync. It's easy to add another jdbc input with a query to get counts of record types, but I don't see a way to do that for the elasticsearch side. Normally, I would do an aggregation query by record type and get the counts of each type. But it seems like logstash's elasticsearch input doesn't handle aggregation queries. Is there a way to do this?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:40am UTC](https://discuss.elastic.co/t/summarizing-elasticsearch-using-logstash/59669/2 "2017-07-06T04:40:13Z")

</div>


