输出

时间:2015-06-25 20:08:09

标签: logstash logstash-configuration

这个简单的配置文件有错误。我已经尝试了一切我能想到的解决方法。我简化了这个例子。最后,我想使用多个输入文件并将它们发送到输出上的不同端口。

input {
  file {
    path => "/home/user/log/*"
    type => "test1"
    start_position => "beginning"
  }
}

output {
  syslog {

    host => "server.com"

    if [type] == "test1" {
      port => 5555
    }

    severity => "informational"
    facility => "syslogd"
  }
}

错误是:

Error: Expected one of #, => at line 14, column 8 (byte 168) after output {
  syslog {

    host => "server.com"

    if

logstash在ubuntu上运行:

apt --installed list|grep logstash
logstash/stable,now 1.4.3-1-7e387fb all [installed]

1 个答案:

答案 0 :(得分:10)

我发现了问题。我需要像这样移动“syslog”:

output {
  if [type] == "test1" {
    syslog {
      host => "server.com"
      port => 5555
      severity => "informational"
      facility => "syslogd"

    }
 }
}