filebeat with alpine, more tiny, more lighter
Branch: master
Clone or download
Pull request Compare This branch is 2 commits ahead of easonlau02:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
5.3.1
5.6.3
6.1.1
6.4.1
LICENSE
README.md

README.md

This project is forked from filebeat-alpine and added version 6.4.1

  • only 40M(6.4.1)
  • customizable configuration
  • deprecated syntax in filebeat.yml was modifed
  • built image: raptor/filebeat

Basic usage

  1. default config

The log files place in the following path:

PATH/[app_name]/logs/*.log

and mount volume:

volumes:
  - PATH:/home/user/ 
  1. customize config:

mount the config file path by volume:

volumes:
  - /path_to_filebeat_yml:/etc/filebeat

The customized filebeat.yml is placed in path_to_filebeat_yml.

Caution: filebeat.yml must be owned by root.root and attribute is rw-r--r--.

本项目源于 filebeat-alpine ,增加了6.4.1版本。

  • 仅40M(6.4.1)
  • 可自定义配置
  • 修改默认配置中即将作废的语法
  • 已发布到dockerhub:raptor/filebeat

基本用法

  1. 默认配置:

日志文件放在如下路径:

PATH/[app_name]/logs/*.log

将路径作如下映射:

volumes:
  - PATH:/home/user/ 
  1. 自定义配置:

自定义配置文件作如下映射:

volumes:
  - /path_to_filebeat_yml:/etc/filebeat

其中path_to_filebeat_yml是存放自定义的filebeat.yml的路径。

注意:自定义的filebeat.yml必须是属于root.root用户,并且属性为rw-r--r--

Why to use filebeat-alpine

filebeat with alpine, more tiny, more lighter, only 16M disk cost.

Supported tags and respective Dockerfile links

Certainly, you have better to clone this git to your local for convenience.

git clone https://github.com/easonlau02/filebeat-alpine.git

Something to know when using eason02/filebeat-alpine

  1. Make sure your application log path need to follow below or link to below path.
PATH/application/logs/*.log
  1. And change docker-compose file
volumes:
  - PATH:/home/user/ 

Will auto-scan your log folder by this path: PATH/*/logs/*.log

  1. Run via docker-compose
docker-compose up -d
  1. docker ps | grep filebeat-alpine
CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS              PORTS               NAMES
8b7a1d8a35c0        eason02/filebeat-alpine:5.3.1   "filebeat -e filebeat"   18 seconds ago      Up 17 seconds                           filebeat-alpine-5.3.1

为什么使用 filebeat-alpine

结合微服务和容器化的思想,将无关的、无用的资源去掉,封装成一个单一,纯净的image镜像,使用当前最轻量级的OS-alpine来封装filebeat,更轻量级,大小只有16M左右,方便快速启动

当然,建议你将本git folder clone到你的本地方便后面启动service

git clone https://github.com/easonlau02/filebeat-alpine.git

使用eason02/filebeat-alpine,一些你需要配置的properties

  1. 确保你的日志文件在如下的路径格式中,其中PATH需要做docker-compose配置的,application这一层可以有很多的app name,每个app folder下面有一个叫做logs的folder,然后下面才是具体的*.log文件
PATH/application/logs/*.log
  1. 用上面的PATH来修改 docker-compose file
volumes:
  - PATH:/home/user/ 

filebeat会通过如下的路径自动扫描日志: PATH/*/logs/*.log

  1. 使用docker-compose启动
docker-compose up -d
  1. docker ps | grep filebeat-alpine
CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS              PORTS               NAMES
8b7a1d8a35c0        eason02/filebeat-alpine:5.3.1   "filebeat -e filebeat"   18 seconds ago      Up 17 seconds                           filebeat-alpine-5.3.1