Elasticsearch as a Logstash input

Hi,
Thanks for looking into this.!
My problem: I need to get the count of documents in an elastic index every hour and store that back in another elastic index. Same I have to do for oracle and get the counts and store in an elastic index.
This is to be done so that I can get the difference in the count of the data synced from ORA to ES (I am syncing data from ORA to ES).

My Approach: I am planning to use logstash to do so. I have created ORA query and am running it as an input in logstash to get the counts via JDBC driver(this works fine).
Not I have to get the count from ES and store in the index, to do so I am taking logstash input from elastic search and running as a query. I just need the counts and pass that value to another ES index every hour.
What query should I use to just return me the counts?

input {
elasticsearch {
hosts => "localhost"
index => "elastictest*"
query => '
{
"query": {
"match_all": {}
}
}
'
}
}

output {

elasticsearch {
   hosts => ["http://localhost:9200/"]
   index => "elastictest-%{+YYYY.MM}"
 }
stdout{}

}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.