A configuration file is required to manage input, filter and output related configuration. The content format of the configuration file is as follows:
# input
input {
...
}
# filter
filter {
...
}
# output
output {
...
}
input {
# file is a common file plug-in, there are many options in the plug-in, you can judge by yourself according to your needs
file {
path => " /var/log/httpd/access_log " # The location of the file to import, you can use *, for example /var/log/nginx /* .log
Excude =>”*.gz” # The file to be excluded
start_position => "beginning" # Read from the beginning of the file, end means read from the end
ignore_older => 0 # Do not read files that have not been modified for a long time , 0 is unlimited, the unit is seconds
sincedb_path => "/dev/null" # Record the last read position of the file, and output to null means that the first line of the file is parsed each time
type => "apache-log" # type field to indicate the type of logs to import
}
}
123