By | February 20, 2016

How to read multiple file logs, files in logstash examples





This tutorial will explain how to process multiple heterogeneous inputs with Logstash

Example 1 - Reading all log files from logs directory

file {
   path => "path/logs/*"
}
 

Example 2 - Reading only .log files or .out files

file {
   path => "path/logs/*.log"
}
file {
   path => "path/logs/*.out"
}
 

Example 3 - Lets say you want to exclude some files from direcotry

file {
  path => "/path/logs/*.log"
  exclude => "/path/logs/*.out"
}
 

Example 4 - Below is the example for reading files from multiple directories in logstash

file {
  path => "/path/logs/**/*.log"
  exclude => "/path/logs/*.gz"
}
 


Leave a Reply

Your email address will not be published. Required fields are marked *