Hi Team ,
I have installed logstash and tried to use filters to get the logs which are present locally to print. But it is not working. I get below error can you please check and help me. Please find below logstash config file
input {
file {
path => "/tmp/server/server1.logs"
start_position => "beginning"
}
}
filter {
if [type] == "syslog" {
grok {
match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:[%{POSINT:syslog_pid}])?: %{GREEDYDATA:syslog_message}" }
add_field => [ "received_at", "%{@timestamp}" ]
add_field => [ "received_from", "%{host}" ]
}
syslog_pri { }
date {
match => [ "syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ]
}
}
}
output {
stdout { codec => rubydebug }
}
when I try to print I get below error message
opt/logstash/bin/logstash -f test1.conf
Error: Expected one of #, if, ", ', } at line 2, column 1 (byte 9) after input {
{:level=>:error}
is something wrong which I am doing. can you please suggest.