ELK的日志

拉取镜像

shell 复制代码
docker pull logstash:7.17.7

创建容器

shell 复制代码
docker run -it \
--name logstash \
--privileged \
-p 5044:5044 \
-p 9600:9600 \
--network wn_docker_net \
--ip 172.18.12.72 \
-v /etc/localtime:/etc/localtime \
-d logstash:7.17.7

配置容器

logstash.yml

shell 复制代码
path.logs: /usr/share/logstash/logs
config.test_and_exit: false
config.reload.automatic: false
http.host: "0.0.0.0"
xpack.monitoring.elasticsearch.hosts: [ "http://192.168.201.61:9200" ]

使用docker cp放到容器内/usr/share/logstash/config目录下

piplelines.xml

xml 复制代码
- pipeline.id: main
  path.config: "/usr/share/logstash/pipeline/logstash.conf"	

使用docker cp放到容器内/usr/share/logstash/config目录下

logstash.conf

yml 复制代码
input {
  tcp {
    mode => "server"
    host => "0.0.0.0"
    port => 5044
    codec => json_lines
  }
}
filter{
}
output {
    elasticsearch {
      hosts => ["192.168.201.61:9200"]       #elasticsearch的ip地址 
      index => "ssc-logs"                          #索引名称
    }
    stdout { codec => rubydebug }
}

使用docker cp放到容器内/usr/share/logstash/pipeline目录下

docker restart重启容器即可

相关推荐
Donk_672 天前
ELK+Redis架构搭建
redis·elk·架构
Plastic garden2 天前
ELK(1)
elk
heimeiyingwang5 天前
【架构实战】日志体系ELK:集中化日志管理实践
elk·架构·wpf
米高梅狮子5 天前
01.ELK企业日志分析系统
运维·服务器·网络·数据库·elk·oracle
叶~小兮7 天前
ELK技术栈全套学习笔记(Elasticsearch+Logstash+Filebeat)
笔记·学习·elk
Cat_Rocky7 天前
k8s-elk日志分析组件学习
学习·elk
RemainderTime8 天前
(十二)Spring Cloud Alibaba 2023.x:基于 Filebeat 构建轻量级 ELK日志追踪体系
分布式·elk·elasticsearch·微服务·架构·logback
明明跟你说过10 天前
Kafka 与 Elasticsearch 的集成应用案例深度解析
大数据·elk·elasticsearch·kafka·big data·bigdata
浓黑的daidai11 天前
day-02
linux·运维·elk
shizhan_cloud13 天前
企业级 ELK 日志分析系统
elk