I have the below file and I'm getting the completely useless error message:
Error: Expected one of #, => at line 85, column 5 (byte 1787) after output {
elasticsearch {
if
____ File below:
input {
beats {
port => 5044
ssl => true
ssl_certificate => "/etc/pki/tls/certs/logstash-forwarder.crt"
ssl_key => "/etc/pki/tls/private/logstash-forwarder.key"
}
}
input {
udp {
host => "0.0.0.0"
port => 2055
codec => netflow { versions => [ 5, 9 ] }
type => "netflow"
}
udp {
host => "0.0.0.0"
port => 9995
codec => netflow { versions => [ 5, 9 ] }
type => "netflow"
}
udp {
host => "0.0.0.0"
port => 1514
type => "syslog-relay"
tags => [ "netsyslog" ]
}
tcp {
host => "0.0.0.0"
port => 1514
type => "syslog-relay"
tags => [ "netsyslog" ]
}
}
filter {
if [type] == "syslog-relay" {
grok { match => { "message" => "(?:<%{INT:priority}>)?%{SYSLOGBASE2} (?:\s?%{LOGLEVEL:log_level} )?(?:\s?%{WORD:log_format}: )?%{GREEDYDATA:syslog_message}" }}
date { match => [ "syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ] }
syslog_pri { }
if ("_grokparsefailure" in [tags]) {
mutate { replace => ["@message", "TOPARSE: %{message}"] }
} else if [log_format] == "json" {
mutate {
gsub => ["syslog_message", "@timestamp", "syslog_timestamp"]
}
json {
source => "syslog_message"
}
mutate {
replace => ["@message", "%{message}"]
}
} else {
mutate {
replace => [ "@message", "%{syslog_message}" ]
}
}
mutate {
remove_field => [
"syslog_hostname", "syslog_message", "syslog_timestamp",
"syslog_severity_code", "syslog_facility_code",
"message" #facility_label", "severity_label"
]
}
}
}
-> part it's complaining about
output {
elasticsearch {
hosts => "localhost:9200"
if [type] == "syslog-relay" {
index => "logstash-%{+YYYY.MM.dd}"
} else if [type] == "netflow" {
index => "flowstash-%{+YYYY.MM.dd}"
}
}
}