使用logstash管理不同类型的日志

使用logstash管理不同类型的日志,logstash,elk,Logstash,Elk,我试图用logstash管理不同类型的日志,但在kibana中没有看到它们。 logstash管道: input { udp { port => 5000 type => "hartbeat" } udp { port => 6000 type => "startup_shutdown" } } ## Add your filters

我试图用logstash管理不同类型的日志,但在kibana中没有看到它们。 logstash管道:

input {
    udp {
        port => 5000
        type => "hartbeat"
    }
    udp {
        port => 6000
        type => "startup_shutdown"
    }
}

## Add your filters / logstash plugins configuration here
filter {
    if [type] == "hartbeat" {
        grok {
                match => { "message" => "\[%{NUMBER:opcode:int},%{NUMBER:sender:int},%{NUMBER:alertbitmap:int},%{NUMBER:bat:float},%{NUMBER:ant:int},%{NUMBER:resbat:int},%{NUMBER:temp:float},%{NUMBER:presatm:int},%{NUMBER:umid:int},%{NUMBER:vertical:int},%{NUMBER:analog1:float},%{NUMBER:analog2:float},%{NUMBER:analog3:float},%{NUMBER:analog4:float},%{NUMBER:spostam:int},%{NUMBER:contporta1:int},%{NUMBER:contporta2:int},%{NUMBER:digital1:int},%{NUMBER:digital2:int},%{NUMBER:digital3:int},%{NUMBER:digital4:int},%{NUMBER:time:int}\]" }
        }
    } 
    if [type] == "startup_shutdown" {
        grok {
                match => { "message" => "\[%{NUMBER:opcode:int},%{NUMBER:sender:int},%{NUMBER:time:int}\]" }
        }
    }
}

output {
    elasticsearch {
        hosts => "elasticsearch:9200"
    }
}

我怎样才能解决这个问题?提前感谢。

如果有任何错误,您是否检查了日志。如果是,请在这里分享。