gpt4 book ai didi

mongodb - 无法配置 mongodb 和 logstash

转载 作者:可可西里 更新时间:2023-11-01 10:31:35 25 4
gpt4 key购买 nike

您好,我是新的 logstash 和 mongodb。我不太确定这里是否适合提问,但我真的需要帮助。我也在 logstash-users google group 中发布了同样的问题,但我没有收到任何答案。此外,我浏览了 google 组的所有帖子,但似乎没有一个解决方案有效。

我需要使用 mongodb 进行输出,所以我运行了以下命令:

./plugin install contrib

之后我运行了这个命令

./logstash agent --config logstash-shipper.conf

我的 logstash-shipper.conf 是

input {

file {

    path => "/var/log/alternatives.log" 
type => "syslog"

}

}

输出{
mongodb {

codec => "plain"
collection => "logstash"
database => "mydb"
generateId => true
isodate => true
uri => "mongodb://localhost:27017/"
} }

我得到了错误

Using milestone 2 input plugin 'file'. This plugin should be stable, but if you see strange behavior, please let us know! For more information on plugin milestones, see http://logstash.net/docs/1.4.0/plugin-milestones {:level=>:warn}
+---------------------------------------------------------+
| An unexpected error occurred. This is probably a bug. |
| You can find help with this problem in a few places: |
| |
| * chat: #logstash IRC channel on freenode irc. |
| IRC via the web: http://goo.gl/TI4Ro |
| * email: logstash-users@googlegroups.com |
| * bug system: https://logstash.jira.com/ |
| |
+---------------------------------------------------------+
The error reported is:
Couldn't find any output plugin named 'mongodb'. Are you sure this is correct? Trying to load the mongodb output plugin resulted in this error: no such file to load -- logstash/outputs/mongodb

最佳答案

据我所知,1.4.2 发行版有些问题。发布的版本名称为“1.4.2-modified”,但贡献版本仍为“1.4.2”。

我的解决方法是找到 ./lib/logstash/version.rb 并更改

LOGSTASH_VERSION = "1.4.2-modified"

LOGSTASH_VERSION = "1.4.2"

这允许

./plugin install contrib

工作(即我的 mongodb 连接现在可以工作),到目前为止没有其他问题。有趣的是,在 version.rb 文件中有一条注释说

# Note to authors: this should not include dashes because 'gem' barfs if
# you include a dash in the version string.

糟糕。

关于mongodb - 无法配置 mongodb 和 logstash,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23189485/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com