When using the index date math, is there a way to be able to add a wildcard into the index name reference?
As some background information, I'm setting up a watch to look for errors in the logs for multiple different dynamic clusters that we index the logs separately, and the index names end up looking like this:
cluster-UUID-1-YYYY.MM.DD cluster-UUID-2-YYYY.MM.DD cluster-UUID-12-YYYY.MM.DD
and so on.
Right now I have the watch set to query indices of name cluster-*
, but it seems rather wasteful of resources to send the query for errors to all the indices every 5 minutes when I'm only searching for errors from now-5m
to now
.
However, when I try to search against a date math index name of <cluster-*-{now/d}>
, I get an index not found exception. Unfortunately, adding each cluster UUID in manually (e.g. <cluster-UUID-1-{now/d}>,...
) is not really an option as the clusters will be created and destroyed dynamically, which is why we're indexing them separately so that the indices for a destroyed cluster's logs can get removed before they'd age out naturally.
Is there a better way for me to restrict the range of indices queried by watcher so that I'm not sending a query for a 5 minute timestamp range to 30+ days worth of logs for potentially dozens or more clusters?
Thanks in advance.
-Joseph