Logstash if statement in output

This simple configuration file has an error. I tried everything I could think of to fix this. I have simplified this example. Ultimately, I would like to use several input files and send them to different ports on the output.

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:

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

    host => "server.com"

    if

logstash runs on ubuntu:

apt --installed list|grep logstash
logstash/stable,now 1.4.3-1-7e387fb all [installed]
+4
source share
1 answer

I found a problem. I needed to move "syslog" like this:

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

    }
 }
}
+8
source

All Articles