I am sending some queries against elasticsearch via curl, called from a batch job.
We are having currently following index pattern: [logstash-]YYYY.MM.DD
So we rotate once per day.
Is there a way that elasticsearch is detecting the needed indexes automatically without querying all available indexes?
If I set logstash-* as index, the result tells me, that all shards have been queried. Since I query only a timeframe, where I need at max 2 days = 2 indexes, I wanted to optimize.
Is there any way to optimize it automatically, or do I need to calculate the queried days and set both indexes in the curl query?