1、配置数据源和输出
config目录下
vi hlchttp.conf
input {
file {
path => "/data/logs/logstash/logstash-tutorial-dataset.log"
start_position => beginning
ignore_older => 0
}
}
output {
elasticsearch {
hosts => "127.0.0.1:9292"
}
stdout {}
}
2、在bin目录下启动
./logstash -f ../config/hlctest.conf
如果报下面这个错
Logstash could not be started because there is already another instance using the configured data directory. If you wish to run multiple instances, you must change the "path.data" setting
可指定其他data目录启动:
./logstash -f ../config/hlctest.conf --path.data=/home/tmp/