簡體   English   中英

使用Logstash進行電子郵件警報

[英]Using logstash for email alert

我在Windows服務器中安裝了logstash 5.5.2,當我發現一些句子時,我想發送電子郵件警報。 我的輸出部分如下:

output {
    tcp {
        host => "host.com"
        port => 1234
        codec => "json_lines"
    }
    if  "The message was Server with id " in [log_message]  {
        email {
            to => "<myName@company.com>"
            from => "<otherName@company.com>"
            subject => "Issue appearance"
            body => "The input is: %{incident}"
            domain => "smtp.intra.company.com"
            port => 25
            #via => "smtp"
        }
    }
}

在調試期間,我收到以下消息:

[2017-09-11T13:19:39,181][ERROR][logstash.plugins.registry] Problems loading a plugin with {:type=>"output", :name=>"email", :path=>"logstash/outputs/email", :error_message=>"NameError", :error_class=>NameError
[2017-09-11T13:19:39,186][DEBUG][logstash.plugins.registry] Problems loading the plugin with {:type=>"output", :name=>"email"}
[2017-09-11T13:19:39,195][ERROR][logstash.agent           ] Cannot create pipeline {:reason=>"Couldn't find any output plugin named 'email'. Are you sure this is correct? Trying to load the email output plugin resulted in this error: Problems loading the requested plugin named email of type output.

我猜是說我沒有安裝電子郵件插件。 有人可以建議解決此問題的方法嗎? 如果有人建議,則不能使用其他解決方案。

感謝和問候,福蒂斯

我嘗試按照官方文檔中的說明進行操作,但是無法創建脫機插件包。 所以我要做的是在客戶端上創建一個正在運行的logstash實例,運行命令以安裝output-email插件logstash-plugin install logstash-output-email ,然后我將此實例復制到我的服務器上(無法訪問互聯網) )。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM