Linux使用 RPM 安装 Logstash

参考网站:https://www.elastic.co/guide/en/logstash/8.5/installing-logstash.html#_yum

1.下载并安装公共签名密钥

rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch

2.创建软件源

cat > /etc/yum.repos.d/logstash.repo << EOF
[logstash-8.x]
name=Elastic repository for 8.x packages
baseurl=https://artifacts.elastic.co/packages/8.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
EOF

3.安装

yum install logstash

 4.添加配置文件

cat > /etc/logstash/conf.d/logstash-elasticsearch.conf << EOF
input {
    stdin {}
}
output {
    elasticsearch {
        hosts => '192.168.182.128:9200'
    }
    stdout {
        codec => rubydebug
    }
}
EOF

 

posted @ 2022-12-04 17:03  SpringCore  阅读(433)  评论(0编辑  收藏  举报