【问题标题】:logstash email plugin install giving errorlogstash 电子邮件插件安装给出错误
【发布时间】:2015-10-28 15:55:18
【问题描述】:

如果字符串匹配,我正在尝试从 logstash 发送电子邮件警报,但是当我要在 logstash 1.4 上安装 logstash-output-email 插件时出现错误

sudo bin/plugin install logstash-output-email
Can only install contrib at this time... Exiting.

我不知道我需要安装那个插件还是它已经安装了

已编辑 升级到 2.0 Logstash 后,我的配置如下所示

output {

elasticsearch { hosts => ["localhost:9200"] }
    if  "ERROR" in [message]  {
    email  {
        options => [ "smtpIporHost", "smtp.gmail.com",
         "port", "587",
         "userName", "test@gmail.com",
         "password", "password",
         "authenticationType", "plain",
         "starttls","true"
           ]
            from => "test@gmail.com"
            subject => "logstash alert"
            to => "test@gmail.com"
            via => "smtp"
            body => "Here is the event line that occured: %{message}"
       }
    }

    stdout { codec => rubydebug }
 }

任何想法并在 logstash 日志中出错

:message=>"Unknown setting 'options' for email", :level=>:error}
{:timestamp=>"2015-11-02T12:59:24.598000+0000", :message=>"Error: Something is wrong with your configuration."}

【问题讨论】:

  • sudo bin/plugin install 在 Logstash 1.4 中不起作用。 Logstash's Plugin Ecosystem 是在 v1.5.0 版本中引入的。有更新的可能吗?
  • 我明天会检查升级到 1.5
  • 升级到 2.0 logstash 后出现错误

标签: email logstash logstash-configuration


【解决方案1】:

升级到 2.0 logstash 后我现在收到错误

是的,因为 options => 已被弃用,并且在 logstash v2.0 中不再可用。请参阅v2.0 email plugin docs。这就是为什么它说:message=>"Unknown setting 'options' for email

您需要将options => 部分中的所有值迁移到新设置中。这样的事情可能会奏效:

email  {
     port           =>    "587"
     address        =>    "smtp.gmail.com"
     username       =>    "test@gmail.com"
     password       =>    "password"
     authentication =>    "plain"
     use_tls        =>    true
     from           =>    "test@gmail.com"
     subject        =>    "logstash alert"
     to             =>    "test@gmail.com"
     via            =>    "smtp"
     body           =>    "Here is the event line that occured: %{message}"
}

查看old v1.5 email docsnew v2.0 email docs,了解有关迁移的更多信息。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-18
    • 1970-01-01
    • 2014-05-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多