Logstash Elasticsearch Input - runs once only?

六眼飞鱼酱① 提交于 2019-12-11 13:40:13

问题


I'm trying to copy a small subset of data from index A into index B.

I have a Logstash config running on an EC2 instance with the Elasticsearch input, some filters and the Elasticsearch output.

This works fine the first time I run it, but if any new data is added to Index A (that meets the input's query criteria) the Logstash config doesn't detect it and output it to Index B.

This has me thinking, does the Elasticsearch input only run once? Unlike inputs like the file or S3 input that will pick up new files added.


回答1:


The Logstash elasticsearch input plugin does a single search (via scan/scroll) with an optional query and when done it quits.

You're right in that it doesn't behave the same way as the for file input plugin, which will simply tail one or more files and handle the new lines on the fly.

You might want to investigate the Watcher plugin if you need a way to be notified when a new document matches a query. Watcher could well detect the presence of a new document matching a query and then call a webhook, which could be materialized by the http input plugin in your Logstash.



来源:https://stackoverflow.com/questions/37163697/logstash-elasticsearch-input-runs-once-only

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!