Summarizing Elasticsearch using Logstash

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?