当前位置:网站首页>Filebeat自定义index和fields
Filebeat自定义index和fields
2022-06-30 19:24:00 【m0_60725291】
如同logstash,默认会生成filebeat-*的索引以及使用解压目录下的fields.yml(二进制压缩包)
这里的需求是解析生成的特定文件,每行记录为json格式的数据,需要:
- 不同的文件生成不同的索引;
- 类型需要定义,原始查询中对于字符串未使用
.keyword,因为默认模板使用的是小于1024是keyword,反之是text,如果要当作keyword使用则是fieldName.keyword;
配置
setup.template.name: custom_name
setup.template.pattern: custom_name_*
setup.template.enabled: false
setup.template.overwrite: false
setup.template.fields: customFields.yml
setup.ilm.enabled: false
processors:
- drop_fields:
fields: [log, host, input, agent, ecs]
ignore_missing: false
filebeat.inputs:
- close_removed: true
close_inactive: 5m
type: log
tags: [t1]
clean_removed: true
enabled: true
json: {
keys_under_root: true, overwrite_keys: true}
paths: [/data/t1_*]
- close_removed: true
close_inactive: 5m
type: log
tags: [t2]
clean_removed: true
enabled: true
json: {
keys_under_root: true, overwrite_keys: true}
paths: [/data/t2_*]
output.elasticsearch:
indices:
- index: custom_name_t1
when.contains: {
tags: t1}
- when.contains: {
tags: t2}
index: custom_name_t2
hosts: ['127.0.0.1:9200']
setup.template.name 设置一个新的模板,模板的名称
setup.template.pattern 模板匹配那些索引
setup.template.enabled: false 关掉默认的模板配置
setup.template.overwrite: false 是否覆盖现有模板
when.contains: 包含
keys_under_root: true 将field展开到最外层(the custom fields are stored as top-level fields in the output document)
自定义模板请查看:Configuration-template
文件路径请查看:Configure project paths
字段定义
setup.template.fields: customFields.yml(路径请查看上述链接),文件格式如下:
- key: custom_name
title: custom_name
description: > custom fields
fields:
# some desc
- name: t1
type: keyword
- name: t2
type: keyword
- name: t3
type: ip
- name: t4
type: integer
- name: t5
type: ip
- name: t6
type: integer
- name: t7
type: ip
- name: t8
type: text
- name: t9
type: date
- name: t10
type: long
边栏推荐
- DELL R720服务器安装网卡Broadcom 5720驱动
- 盘点华为云GaussDB(for Redis)六大秒级能力
- 解决arm_release_ver of this libmali is ‘g2p0-01eac0‘,rk_so_ver is ‘4‘,libgl1-mesa-dev不会被安装,存在未满足的依赖关系
- c语言数组截取,C# 字符串按数组截取方法(C/S)
- A necessary tool for testing -- postman practical tutorial
- 实现各种效果和功能的按钮,读这篇文章就够了
- Django上传excel表格并将数据写入数据库的详细步骤
- 【已解决】抖音如何取消关注已注销的账户
- Application of VoIP push in overseas audio and video services
- Go language learning tutorial (10)
猜你喜欢

Friends in Guangzhou can join us if they have the opportunity

RP原型资源分享-购物类App

线上线下双结合,VR全景是家具线上转型好方法!

企业中台规划和IT架构微服务转型

Why must a digital transformation strategy include continuous testing?

A necessary tool for testing -- postman practical tutorial

4.3-inch touch screen 12 channel control port programmable network central control supports mutual backup of 5 central control hosts

8 - 函数

The prospectus of pelt medical was "invalid" for the second time in the Hong Kong stock exchange, and the listing plan was substantially delayed

Detailed explanation of specific methods and steps for TCP communication between s7-1500 PLCs (picture and text)
随机推荐
CV+Deep Learning——网络架构Pytorch复现系列——basenets(BackBones)(一)
Redis ziplist 压缩列表的源码解析
mysql统计账单信息(上):mysql安装及客户端DBeaver连接使用
无线充U型超声波电动牙刷方案开发
解决arm_release_ver of this libmali is ‘g2p0-01eac0‘,rk_so_ver is ‘4‘,libgl1-mesa-dev不会被安装,存在未满足的依赖关系
Is it safe to open an account for mobile phone stock trading!?
Tupu software has passed CMMI5 certification| High authority and high-level certification in the international software field
Tencent conference application market was officially launched, with more than 20 applications in the first batch
Go language learning tutorial (13)
The former king of fruit juice sold for 1.6 billion yuan
达梦数据库重新初始化实例操作记录
实现各种效果和功能的按钮,读这篇文章就够了
mysql主从同步
传输层 使用滑动窗口实现流量控制
WeakSet
太湖 “中国健康农产品·手机直播万里行”走进太湖
qt中toLocal8Bit和toUtf8()有什么区别
SQL continuous login problem
更智能!AIRIOT加速煤炭行业节能减排升级
漫画 | Oracle 被新时代抛弃了吗?