简单系统日志的格罗克模式

问题描述 投票:0回答:1

我正在使用7.2.0的ELK设置和filebeat 7.2.0。现在,我已在filebeata和im tryign中启用系统模块,以在Logstash中使用简单的grok,

input {
  beats {
    port => 5044
    ssl  => false
  }
}
filter {
  if [fileset][module] == "system" {
          grok {
        match => { "message" => "%{SYSLOGLINE}"}
}
}
output {
  elasticsearch {
    hosts => ["10.16.5.24:9200"]
    index => "rehatsystemlogs"
}
        stdout { codec => rubydebug }
}

示例日志:Nov 17 08:01:01 strproelk02 systemd: Removed slice User Slice of root.

现在,当我在https://grokdebug.herokuapp.com/中检查%{SYSLOGLINE}以获取此示例日志时,无法通过日志拆分获得正确的输出。

但是当我执行logstash时,单独的列不会在ES的索引中拆分。

我要去哪里错了?

logstash elastic-stack logstash-grok logstash-configuration grok
1个回答
0
投票

缺少大括号,过滤器的末尾,

 input {
  beats {
    port => 5044
    ssl  => false
  }
}
filter {
  if [fileset][module] == "system" {
          grok {
        match => { "message" => "%{SYSLOGLINE}"}
       }
     }
}
output {
  elasticsearch {
    hosts => ["10.16.5.24:9200"]
    index => "rehatsystemlogs"
}
        stdout { codec => rubydebug }
}
© www.soinside.com 2019 - 2024. All rights reserved.