安装 filebeat-7.9.3(与Elasticsearch版本一致)

考虑到Elasticsearch 比较费硬盘空间,所以目前项目中只上传error的日志。详细日志还是去具体服务器查看(没有专门运维)

普通安装:

  1. 上传并解压filebeat-7.9.3-linux-x86_64.tar.gz,
  2. 修改 filebeat.yml,
  3. 启动 ./filebeat -c filebeat.yml -e

Docker 安装

docker pull elastic/filebeat:7.9.3

将 filebeat.yml 文件传到linux 服务器 /opt/filebeat 目录中

filebeat.inputs:

# Each - is an input. Most options can be set at the input level, so
# you can use different inputs for various configurations.
# Below are the input specific configurations. - type: log
enabled: true
paths:
- /opt/logs/ai_api_dev/*.log
# - /opt/logs/ai_api_dev/*error*.log # 只看error
#- D:\Projects\logs\*.log fields:
# 额外添加的字段
project-name: ai_api_dev
exclude_lines: ['DEBUG']
tags: ["ai_api_dev"] - type: log
enabled: true
paths:
- /opt/logs/ai_schedule_dev/*.log
fields:
project-name: ai_ecgreport_schedule_dev
exclude_lines: ['DEBUG']
tags: ["ai_schedule_dev"] # ---------------------------- Elasticsearch Output ---------------------------- output.elasticsearch:
# Array of hosts to connect to.
hosts: ["172.16.3.61:9200"]
indices:
- index: "ai_api_dev_%{[agent.version]}-%{+yyyy.MM.dd}"
when.contains:
tags: "ai_api_dev"
- index: "ai_schedule_dev_%{[agent.version]}-%{+yyyy.MM.dd}"
when.contains:
tags: "ai_schedule_dev" processors:
- drop_fields:
fields: ['agent']
when.contains:
tags: "ai_api_dev"
- drop_fields:
fields: ['agent']
when.contains:
tags: "ai_schedule_dev"

文件权限 755 ,不能是777,否则会报

Exiting: error loading config file: config file ("filebeat.yml") can only be writable by the owner but the permissions are "-rwxrwxrwx" (to fix the permissions use: 'chmod go-w /usr/share/filebeat/filebeat.yml')

#运行
docker run --name filebeat --restart always --privileged=true -d \
-v /opt/filebeat/logs/:/logs/ \
-v /opt/filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml \
-v /data/tenant/service/:/data/tenant/service \
-v /opt/logs/:/opt/logs/ \
elastic/filebeat:7.9.3 #查看日志
docker logs --tail=100 -f d69

Observability => 日志

Filebeat的安装和使用(Linux)的更多相关文章

  1. 在同一个硬盘上安装多个 Linux 发行版及 Fedora 21 、Fedora 22 初体验

    在同一个硬盘上安装多个 Linux 发行版 以前对多个 Linux 发行版的折腾主要是在虚拟机上完成.我的桌面电脑性能比较强大,玩玩虚拟机没啥问题,但是笔记本电脑就不行了.要在我的笔记本电脑上折腾多个 ...

  2. UEFI模式安装Win10和Linux双系统

    最近心血来潮,想装一个Linux.Windows双系统,吸取上次安装的经验,这次一定都要使用UEFI模式启动,需要注意的是必须是支持此种启动模式的系统(一般解压之后都有efi文件夹不需要刻录),这次遇 ...

  3. VirtualBox下安装rhel5.5 linux系统

    以前也用过VMware server和VMware workstation虚拟机,现在使用了一段时间VirtualBox,感觉它比较轻巧,很适合我,在Win7系统下用起来很方便.下面详细介绍下在Vir ...

  4. (转)Linux下安装rar fou linux

    在Linux下安装rar fou linux rar for linux 软件下载地址:http://www.rarsoft.com/download.htm 到目前为止最新的版本为4.10 beta ...

  5. Windows与Linux的双系统的安装顺序及Linux的补救办法

    如果安装多重引导,最好先安装Windows再安装Linux系统,因为: Linux在安装的时候,你可以选择将引导加载程序安装在MBR或个别分区的启动扇区,而且Linux的loader可以手动设置菜单( ...

  6. Ubuntu安装wps for linux

    1.WPS For Linux 2013 还是只提供了32位版本,我用的是 64位 Ubuntu,如果您也是64位系统,还需要提前安装一些32位的库文件. sudo apt-get install i ...

  7. Ubuntu 12.04 安装sougou for linux

    安装sougou for linux: 1.卸载原有的输入法,fcitx或ibus.如卸载fcitx: sudo apt-get remove fcitx*(如不需保留配置文件用purge) sudo ...

  8. 如何在CentOS 5.x 中安装Windows Azure Linux Agent (WALA)

    Qing Liu  Tue, Mar 10 2015 3:06 AM 在今天的这一个章节中,我们主要讨论在CentOs 5.x 中如何安装Windows Azure Linux Agent 2.11 ...

  9. Centos下安装配置LAMP(Linux+Apache+MySQL+PHP)

    Centos下安装配置LAMP(Linux+Apache+MySQL+PHP)   关于LAMP的各种知识,还请大家自行百度谷歌,在这里就不详细的介绍了,今天主要是介绍一下在Centos下安装,搭建一 ...

  10. VMware Workstation 12 Player之安装林耐斯-Linux Deepin -系统

    VMware Workstation 12 Player之安装林耐斯-Linux Deepin -系统... ============= ============= ============= === ...

随机推荐

  1. STM8 STM32 GPIO 细节配置问题

    在MCU的GPIO配置中我们经常需要预置某一 IO 上电后为某一固定电平, 如果恰好我们需要上电后的某IO为高电平, 那么在配置GPIO的流程上面需要特别注意. 配置如下: (以下问题仅在STM8 / ...

  2. Vue源码学习(十六):diff算法(三)暴力比对

    好家伙,这是diff的最后一节了   0.暴力比对的使用场景 没有可复用的节点:当新旧虚拟 DOM 的结构完全不同,或者某个节点不能被复用时,需要通过暴力比对来创建新的节点,并在真实 DOM 上进行相 ...

  3. auto关键词

    前言 这个东西在新版本的 C 语言中还是很常用的,尤其是用到 for 循环中.蒟蒻之前也是对这个了解不多,基本没用过(除非迫不得已,因为我的C++编译器太逊了,不支持此操作,用这个操作还得用在线 ID ...

  4. Python 潮流周刊#27:应该如何处理程序的错误?

    你好,我是猫哥.这里每周分享优质的 Python.AI 及通用技术内容,大部分为英文.本周刊开源,欢迎投稿.另有电报频道作为副刊,补充发布更加丰富的资讯. 产品推荐 Walles.AI 是一款适用于所 ...

  5. 1. Shell 基本用法

    重点: 条件测试. read. Shell 环境配置. case. for. find. xargs. gzip,bzip2,xz. tar. sed. 1)编程基础 Linus 说:Talk is ...

  6. .NET8极致性能优化CHRL

    前言 .NET8在.NET7的基础上进行了进一步的优化,比如CHRL(全称:CORINFO_HELP_RNGCHKFAIL)优化技术,CORINFO_HELP_RNGCHKFAIL是边界检查,在.NE ...

  7. 最小生成树(Prim、Kruskal)

    MST 引入 现在有一个连通图,他有\(N\)个节点,\(M\)条边 当我们砍掉一些边时,它会变成一棵树,其剩下的边权之和即为这棵树的权,当剩下的权值最小时,称这棵树为此图的最小生成树,即MST 模版 ...

  8. KR4-KP4

    serdes测试中经常遇到KR4 和KP4, KR4指的是FEC 528 514对应25X4的100G KP4对应FEC 544 514,56/100x4 的200/400G链路 KP4应用比较广泛, ...

  9. MinIO客户端之alias

    MinIO提供了一个命令行程序mc用于协助用户完成日常的维护.管理类工作. 官方资料 mc alias mc alias list mc alias remove mc alias set mc al ...

  10. 微软成为PostgreSQL主要贡献者

    微软成为PostgreSQL主要贡献者 微软对PostgreSQL贡献的很多新功能都来自于客户在使用微软Azure上的PostgreSQL管理实例数据库,所以这些新功能都来自于真实的客户需求 微软对P ...