一. 下载解压
- wget https://artifacts.elastic.co/downloads/logstash/logstash-6.5.4.tar.gz
- tar -zxvf logstash-6.5.4.tar.gz
- cd logstash-6.5.4
二.新建logstash.conf配置文件
vim logstash.conf
input {
file {
path => ["/server/logstash-6.5.4/testFile.txt"]
start_position => "beginning"
}
}
filter {
}
output {
stdout{}
}
logstash 从 testFile.txt 获取内容,并输出
三.启动测试
./bin/logstash -f logstash.conf
向文件输入"hello world" ,且可以输出
echo "hello world" > testFile.txt