2022.06.30 Linux 安装 Logstash

一、下载地址

https://www.elastic.co/cn/downloads/past-releases#logstash

注意:需要和Elasticsearch 用相同的版本,这里以7.2.1为例

二、安装Logstash

1.解压tar包

cd /usr/local 
tar zxvf logstash-7.2.1.tar.gz

2.配置config目录下的logstash.conf

input {
    tcp {
        host => "0.0.0.0"
        port => 4560
        mode => "server"
        codec => json_lines
    }

}
output {
    elasticsearch {
        hosts => "localhost:9200"
        index => "%{[diqishop]}"
    }
}

3.启动命令

cd /usr/local/logstash-7.2.1 
nohup ./bin/logstash -f config/logstash.conf &

4.查看Logstash是否启动成功

ps -ef | grep logstash

你可能感兴趣的:(2022.06.30 Linux 安装 Logstash)