docker容器日誌插件elastic-logging-plugin輸出到es

1、安裝插件

 docker plugin install elastic/elastic-logging-plugin:8.11.3

2、修改/etc/docker/daemon.json 

 

{
  "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn","http://hub-mirror.c.163.com","https://docker.mirrors.ustc.edu.cn","https://registry.docker-cn.com"],
  "exec-opts": ["native.cgroupdriver=systemd"],
  #"log-driver": "json-file",
  #"log-opts": {
  #  "max-size": "100m"
  #},
  "log-driver" : "elastic/elastic-logging-plugin:8.12.0",
  "log-opts" : {
    "hosts" : "https://127.0.0.1:9200"
    #"user" : "myusername",
    #"password" : "mypassword"
  },
  "storage-driver": "overlay2",
  "storage-opts": [
    "overlay2.override_kernel_check=true"
  ]
}

3、重啓 docker

4、重建容器

5、查詢數據

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章