分类

链接

2024 年 12 月
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

近期文章

热门标签

新人福利,免费薅羊毛

现在位置:    首页 > Others > 正文
共享办公室出租
Filebeat + ZincSearch 轻量级日志
Others 暂无评论 阅读(16)

Filebeat:轻量级日志采集工具;

Zinc:ElasticSearch 的轻量级替代,其 API 可与 ES 通用;

本文采用 Filebeat 采集日志,输出到 Zinc 进行存储与展示。

Filebeat(GO开发) 虽然功能更精简,但是上手更快,特别是占用资源大大减少。

ElasticSearch 过于笨重,本文采用 ZincSearch 替代 ES。

 

 

 

安装 ZincSearch

下载对应版本:Releases · zinclabs/zinc (github.com)

 

 

Docker Compose安装:

version : '3'
services:      
  zincsearch:
    image: public.ecr.aws/zinclabs/zincsearch:latest
    container_name: zincsearch
    extra_hosts:
      - "host.docker.internal:host-gateway"
    volumes:
      - /root/zincsearch/data/:/data
    environment:
      ZINC_DATA_PATH: "/data" 
      ZINC_FIRST_ADMIN_USER: admin
      ZINC_FIRST_ADMIN_PASSWORD: 123456      
    ports:
      - "8000:4080"
    restart: always
    deploy:
      resources:
        limits:
          memory: 1000m   
  filebeat:
    image: docker.elastic.co/beats/filebeat:8.5.0
    container_name: filebeat
    restart: always
    privileged: true
    user: root
    extra_hosts:
      - "host.docker.internal:host-gateway"
    volumes:
      - /var/lib/docker/containers:/var/lib/docker/containers:ro
      - /root/zincsearch/filebeat.yml:/usr/share/filebeat/filebeat.yml
      - /var/run/docker.sock:/var/run/docker.sock:ro
    deploy:
      resources:
        limits:
          memory: 1000m

filebeat.yml:

processors:
  - add_cloud_metadata: ~
  - add_docker_metadata: ~

setup.ilm.enabled: false  

filebeat.autodiscover:
  providers:
    - type: docker
      hints.enabled: true
      templates:
        - condition:
            or:
              - equals.docker.container.name: "filebeat"
              - equals.docker.container.name: "kibana"
              - equals.docker.container.name: "es"
              - equals.docker.container.name: "redis"
              - equals.docker.container.name: "elastalert"
              - equals.docker.container.name: "zincsearch"
          config:
            processors:
              - drop_event: ~

    
filebeat.config:
  modules:
    path: ${path.config}/modules.d/*.yml
    reload.enabled: false



output.elasticsearch:
  hosts: ['http://zincsearch:4080']
  path: '/es/'
  #index: "docker-log-%{+yyyy.MM.dd}"
  username: "admin"
  password: "123456"
  #允许使用低版本的ES
  #allow_older_versions: true

 

============ 欢迎各位老板打赏~ ===========

本文版权归Bruce's Blog所有,转载引用请完整注明以下信息:
本文作者:Bruce
本文地址:Filebeat + ZincSearch 轻量级日志 | Bruce's Blog

发表评论

留言无头像?