ELK7.X搭建(三)logstash安装与配置

1下载解压国内镜像

wget https://mirrors.huaweicloud.com/logstash/7.5.1/logstash-7.5.1.tar.gz

2在config目录下新建配置文件logstash.conf,如果实现logstash与springboot整合,使得springboot程序的log存储到logstash中并发送到es中,新建的配置文件可以如下:

input {
  tcp {
    mode => "server"
    host => "0.0.0.0"
    port => 4560
    codec => json_lines
  }
}
output {
  elasticsearch {
    hosts => "192.168.65.3:9200"
    index => "springboot-logstash-%{+YYYY.MM.dd}"
  }
}

3启动logstash

cd /usr/local/logstash-7.5.1/bin

./logstash -f ../config/logstash.conf

启动成功

ELK7.X搭建(三)logstash安装与配置_第1张图片

参考文章

https://blog.csdn.net/qq_23435961/article/details/108118569

https://blog.csdn.net/weixin_34183910/article/details/91377384

https://blog.csdn.net/syc000666/article/details/98668485

你可能感兴趣的:(elasticsearch,linux)