搭建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"
相关推荐
代码民工正电荷6 小时前
JAVA重要知识点和集合
java·开发语言
星恒随风6 小时前
C++11 加餐(4)并发支持库——condition_variable 条件变量与生产者消费者模型
开发语言·c++
利威尔xu6 小时前
Go map 并发十连问:多 goroutine 同时读写触发 fatal error,进程直接崩溃
开发语言·golang
你不知道我是谁?7 小时前
GESP C++ 补充知识:浮点数格式化输出(%f/%e/%g)与 fmod 浮点余数实战
开发语言·c++
九蝶科技7 小时前
运费分摊的二开实现:BigDecimal 精确分摊 + 尾差补齐 + 暂估调整
开发语言·python
Ryan-Zhong8 小时前
一次接入 16 个平台:视频链接元数据解析 API 的 Python 实战与踩坑记录
开发语言·python·dreamweaver
无限聚核9 小时前
PHP 对接美团、抖音团购核销接口:预核销、核销、重试和撤销一份代码跑通,无限聚核
开发语言·php·美团·团购核销接口
向科→向总工→空间动态计系统10 小时前
动态零轴融合三铁律
大数据·开发语言·人工智能·python·机器人
西西弗Sisyphus12 小时前
C++ 最小 Agentic Loop 实现 - 开始实现 完整的内容
开发语言·c++
2603_9658966212 小时前
JavaScript 原型与原型链,读懂 JS 对象的底层机制
开发语言·javascript·原型模式