# ElasticsearchException: 汇总作业[my_rollup]无法启动，因为索引模式[logs-*]不匹配任何现有索引

- **ID:** `elasticsearch/rollup-job-not-matching-indices`
- **领域:** elasticsearch
- **类别:** config_error
- **错误码:** `ROLLUP_NO_MATCHING_INDICES`
- **验证级别:** ai_generated
- **修复率:** 82%

## 根因

汇总作业的索引模式不匹配集群中的任何索引，阻止作业初始化。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Elasticsearch 7.13 | active | — | — |
| Elasticsearch 8.3 | active | — | — |
| Elasticsearch 8.12 | active | — | — |

## 解决方案

1. ```
   使用`GET _cat/indices/logs-*`验证现有索引，并调整汇总作业模式以匹配：`PUT _rollup/job/my_rollup/_stop`然后`PUT _rollup/job/my_rollup {"index_pattern": "logs-2025-*"}`
   ```
2. ```
   在启动作业前创建匹配模式的示例数据索引：`POST logs-2025-01/_doc {"timestamp": "2025-01-01", "value": 10}`
   ```

## 无效尝试

- **Creating an empty index matching the pattern (e.g., `PUT logs-2025`) without data** — The rollup job may start but will produce no results, and the empty index may cause other issues. (60% 失败率)
- **Modifying the rollup job to use a wildcard pattern like `*`** — This may match unintended indices, causing performance degradation or incorrect rollups. (70% 失败率)
- **Restarting the rollup job without checking index existence** — The same error will recur as the index pattern remains unmatched. (90% 失败率)
