用于向 Jira 进行身份验证的 Logstash http_poller 插件失败

Logstash http_poller plugin to authenticate to Jira is failing

我在使用 Logstash 配置文件从 jira 检索内容时遇到问题。我的配置文件如下

input {
    http_poller {
        urls => {
            test1 => {
                method => get
                url => "jira url for specific issue"
                headers => {
                    Accept => "application/json"
                }
                auth => {
                    user => "username"
                    password => "passwd"
                }
            }   
        }
        request_timeout => 60
        interval => 3600
        codec => "json"
    }
}

output {
    elasticsearch {}
    stdout {}
}

当我查询创建的新索引时,我从结果中得到以下消息:

    "errorMessages" : [ "You do not have the permission to see the specified issue.", "Login Required" ],

我尝试了用户名的变体,例如 username@company.com,但也没有成功。我还通过使用给定用户名和密码的常规 curl 命令验证了 JIRA 身份验证有效。有人看到 Logstash 的问题吗?

所以我找到了一个解决方法。还有另一个名为 exec 的 Logstash 输入插件,它会定期运行 shell 命令。因为我可以使用 curl 连接到 Jira,所以我只是用它来检索数据。

如果不担心使用旧版本的 elasticsearch,另一种可行的解决方案是使用下面的 river 插件: https://github.com/searchisko/elasticsearch-river-jira。它太棒了,几乎可以做你需要的一切。