Logstash: Filter out the service to file

Hi folks,

I just want to filter out only apache and MySQL logs from the logstash output,
I had configured the pipeline.conf file its not working.

please suggest me to solve this

# INPUT HERE
input {
beats {
        port => 5044
}
}
# FILTER HERE
filter{
if [source]=="/var/log/apache2/error.log"
{
mutate {
         add_tag => [ "apache_logs" ]
 }
}
}
# OUTPUT HERE
output {
   if "apache_logs" in [tags] {
            file {
           path => "/home/ubuntu/apache.log"
   }
  }
}

@magnusbaeck

Use a stdout { codec => { rubydebug } output to dump an example event so we can see what it looks like.

its not working, i need to put in separate file

@magnusbaeck

its not working, i need to put in separate file

I don't understand what you mean.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.