elastic / beats

:tropical_fish: Beats - Lightweight shippers for Elasticsearch & Logstash
https://www.elastic.co/products/beats
Other
12.14k stars 4.91k forks source link

[Filebeat-v8.6.0] Title: 400 error when writing with custom template in filebeat.yml #40756

Open jinman0826 opened 6 days ago

jinman0826 commented 6 days ago

Description: I am using Filebeat version V8.6.0. When I configure setup.template.name: "test-clx" and setup.template.pattern: "test-clx-", a 400 error occurs. However, data can still be written normally. But when I remove the after the index in setup.template.pattern, there is no error. I am not sure why this error occurs. I hope to get help to solve this problem so that I can use the custom template for data writing correctly. Steps to reproduce: Install Filebeat version V8.6.0. Configure setup.template.name: "test-clx" and setup.template.pattern: "test-clx-" in filebeat.yml. Observe a 400 error, but data can still be written normally. Remove the after the index in setup.template.pattern, and the error disappears. filebeatLogs {"log.level":"error","@timestamp":"2024-09-11T14:32:13.436Z","log.logger":"publisher_pipeline_output","log.origin":{"file.name":"pipeline/client_worker.go","file.line":150},"message":"Failed to connect to backoff(elasticsearch(http://1xxxxxxx:9200)): Connection marked as failed because the onConnect callback failed: error loading template: failed to put data stream: could not put data stream: 400 Bad Request: {\"error\":{\"root_cause\":[{\"type\":\"illegal_argument_exception\",\"reason\":\"no matching index template found for data stream [test-clx]\"}],\"type\":\"illegal_argument_exception\",\"reason\":\"no matching index template found for data stream [test-clx]\"},\"status\":400}. Response body: {\"error\":{\"root_cause\":[{\"type\":\"illegal_argument_exception\",\"reason\":\"no matching index template found for data stream [test-clx]\"}],\"type\":\"illegal_argument_exception\",\"reason\":\"no matching index template found for data stream [test-clx]\"},\"status\":400}","service.name":"filebeat","ecs.version":"1.6.0"}

botelastic[bot] commented 6 days ago

This issue doesn't have a Team:<team> label.

jinman0826 commented 5 days ago

"I've discovered an issue: with setup.template.pattern: "clx-", using the pattern clx works fine, but when using clx-*, it causes problems. Could this be due to a version-related issue?"