首页 > 其他分享 >filebeat7.9.2设置字段

filebeat7.9.2设置字段

时间:2023-01-18 11:03:32浏览次数:43  
标签:log filebeat7.9 access 5601 设置 path type metadata


当测试环境的日志类型有多个时,比如,NGINX,jar包日志,等等,用filebeat采集日志时可以设置多个字段,编辑filebeat.yml

filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/nginx/access.log
encoding: GB2312
fields:
type: www_access
- type: log
paths:
- /var/log/nginx/io.error.log
encoding: GB2312
fields:
type: www_error
- type: log
paths:
- /var/log/nginx/doc.access.log
encoding: GB2312
fields:
type: doc_access
# ============================== Filebeat modules ==============================

filebeat.config.modules:
# Glob pattern for configuration loading
path: ${path.config}/modules.d/*.yml

# Set to true to enable config reloading
reload.enabled: false

# Period on which files under path should be checked for changes
#reload.period: 10s
# ======================= Elasticsearch template setting =======================

setup.template.settings:
index.number_of_shards: 1
#index.codec: best_compression
#_source.enabled: false
# =================================== Kibana ===================================

# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.
# This requires a Kibana endpoint configuration.
setup.kibana:

# Kibana Host
# Scheme and port can be left out and will be set to the default (http and 5601)
# In case you specify and additional path, the scheme is required: http://localhost:5601/path
# IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
host: "192.168.**:5601"
# ---------------------------- Elasticsearch Output ----------------------------
output.elasticsearch:
# Array of hosts to connect to.
hosts: ["192.168.**:9200"]
# ================================= Processors =================================
processors:
- add_host_metadata:
when.not.contains.tags: forwarded
- add_cloud_metadata: ~
- add_docker_metadata: ~
- add_kubernetes_metadata: ~


标签:log,filebeat7.9,access,5601,设置,path,type,metadata
From: https://blog.51cto.com/u_15943246/6019145

相关文章

  • npm、yarn和pnpm 设置淘宝镜像
    npm、yarn和pnpm淘宝镜像//设置npmconfigsetregistryhttps://registry.npmmirror.com/yarnconfigsetregistryhttps://registry.npmmirror.com/pnpmconf......
  • fixed 定位设置 scroll 不滚动
    我的问题是把容器的高度设置成了100vw,和视口保持同样的高度,所以设置scroll也无法滚动。尽管我试了很多其他方法都不能让其滚动。把高度设置成100%就可以了,结构如下:<......
  • java虚拟机日志跟踪相关设置
     GC详细日志简要分析:2023-01-17T14:16:23.810+0800:10233.942:[GC(AllocationFailure)2023-01-17T14:16:23.810+0800:10233.942:[DefNew:70396K->439K(78720K......
  • cshrc基础设置
    每次拿到新机器都要重新设置下shell的rc,让terminal看的更舒服一些,这里把常用的一些语法设置记录下。1aliasclrclear2aliasggvim3aliasls'ls--color'4alias......
  • 10. Pytest设置用例标签:mark
    一、前言mark主要用来标记用例,通过不同的标记实现不同的运行策略。一个大项目自动化用例时,可以划分多个模块,也可以使用标记功能,标明哪些是模块1用例,哪些是模块2的,运行代码......
  • angular 下 nztable分页设置
    网上搜了一圈,竟然没有一篇正经讲分页配置的,好多都是自己做个控件替代原生的。然后我翻了一遍底层ts试了下,发现自带的配置其实并不复杂。 nzItemRender:TemplateRef<Pag......
  • 设置apt安装软件时是否保留下载的deb包(apt不清理/apt下载软件包)
    原文:https://blog.csdn.net/FoxBryant/article/details/123226245不喜欢CSDN,记录一下。默认情况下使用aptinstall安装包时,会自动下载安装包及其依赖包到/var/cache/apt/......
  • 深信服AF设置web登录管理后台
    目的:因安全性考虑设置只有某个ip段访问AF后台1、网络---接口/区域---区域---LAN2、LAN区域---三层区域---WEBUI--允许管理此设备的IP---选择网络对象---添加ip或ip段3、测试......
  • 【微信小程序】缓存过期时间的相关设置
    微信小程序缓存机制介绍  每个微信小程序都可以有自己的本地缓存,可以通过​​wx.setStorage(wx.setStorageSync)​​​、​​wx.getStorage(wx.getStorageSync)​​​、​​w......
  • Ubuntu20如何设置开机自启动shell脚本
    Ubuntu20如何设置开机自启动shell脚本?需求:我有一个Jenkins工程,是手敲命令启动的。但每次开机都要手动执行一次命令,很不方便,能否设置为开机自动启动?系统是Ubuntu20.04版......