搭建elk环境并接入frostmourne,实现监控报警效果(五)

#修改权限目录,id 1000的账号

chown -R meng.meng data*

chmod -R 777 data*

#docker-compose.yaml

复制代码
version: '3.8'
services:
  filebeat:
    # 镜像名称
    image: docker.elastic.co/beats/filebeat:8.6.0
    # 容器名称
    hostname: filebeat
    container_name: filebeat
    #ports:
    #  - 5044:5044
    volumes:
      - /data/elk_monitor/filebeat:/usr/share/filebeat
#      - /var/log/messages:/var/log/messages
      - /data/logs:/data/logs
    networks:
      - meta 
    deploy:
      replicas: 1
networks:
  meta:
    external: true # 用已经创建好的网络

#启动

docker-compose up -d

#测试

复制代码
setup.kibana:
  host: "192.168.10.14:5601"

output.elasticsearch.allow_older_versions: true
filebeat.inputs:
- input_type: log
  paths:
    - /data/logs/t1.log
  json.keys_under_root: true
  json.overwrite_keys: true
  fields:
    index: 't1_history'

- input_type: log
  paths:
    - /data/logs/t2.log
  json.keys_under_root: true
  json.overwrite_keys: true
  fields:
    index: 't2_history'

output.elasticsearch:
  hosts: ["192.168.10.14:9200"]
  username: "elastic"
  password: "vsUZGKNvjWRtTKPmDG"110120  
  indices:
    - index: "t1_history"
      when.contains:
        fields:
          index: "t1_history"
    - index: "t2_history"
      when.contains:
        fields:
          index: "t2_history"
相关推荐
oh,huoyuyan2 小时前
JS 动态网页抓不到?试试火车采集器网页抓取工具
开发语言·javascript·ecmascript
风流 少年2 小时前
hutool
java·服务器·开发语言
一木 之林3 小时前
四、STL容器与数据结构
开发语言·数据结构·c++
QX_hao3 小时前
【Go】--Cobra-cli的用法
开发语言·后端·golang
艾醒(AiXing-w)3 小时前
LangChain 1.0 入门(三):稳定性双核心——重试机制+速率限速器参数详解与实战
开发语言·langchain·php
总有刁民想爱朕ha3 小时前
Python PyQt5图片批量转MP4视频工具:本地离线免费无水印,完整代码
开发语言·python·qt
宸津-代码粉碎机4 小时前
FastUtil+AI多Agent实战:Java AI项目性能终极加速方案
java·服务器·开发语言·python·安全·php
Python私教4 小时前
Python 3.15 来了:free-threading 稳定 ABI 能给高并发服务带来什么
开发语言·python
Logintern095 小时前
[Matlab] 遗传算法求解TSP入门
开发语言·matlab