如何使用logstash输入弹性索引索引动态值
请帮我。
我想要的是知道如何在LogStash Elasticsearch输入期间动态更改索引。
我希望这个
input {
elasticsearch {
hosts => localhost:9200
index => index-+{yyyy}-{increasing value}
}
}
结果
input {
elasticsearch {
hosts => localhost:9200
index => index-2022-52
}
}
我需要能够设置每天更改的价值。
例如)使用Linux脚本
预先感谢您的帮助。
Please help me.
What I want is to know how to dynamically change the index during logstash elasticsearch input.
i want this
input {
elasticsearch {
hosts => localhost:9200
index => index-+{yyyy}-{increasing value}
}
}
result
input {
elasticsearch {
hosts => localhost:9200
index => index-2022-52
}
}
I need to be able to set the value to change every day.
ex) Using Linux scripts
Thank you in advance for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以利用环境变量。
您的输入配置看起来像这样:
然后在运行LogStash之前从外壳设置这些变量
You can leverage environment variables.
Your input configuration would look like this:
And then set those variables from your shell just before running Logstash