当前位置:网站首页>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
边栏推荐
- mysql主从同步
- Data intelligence - dtcc2022! China database technology conference is about to open
- Application of VoIP push in overseas audio and video services
- Alibaba Tianchi SQL training camp learning notes 5
- Wechat applets - basics takes you to understand the life cycle of applets (2)
- neo4j load csv 配置和使用
- Is it safe to open an account for mobile phone stock trading!?
- 1. 爬虫之Beautifulsoup解析库&在线解析图片验证码
- Idle fish is hard to turn over
- yolo 目标检测
猜你喜欢

企业中通过组策略管理Edge浏览器设置(IE模式、主页绑定等)

qt中toLocal8Bit和toUtf8()有什么区别

Conditional compilation

RP prototype resource sharing - shopping app

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

测试必备工具 —— Postman实战教程

《微信小程序-基础篇》带你了解小程序中的生命周期(二)

Code shoe set - mt3435 · assignment - bipartite graph problem - Graphic explanation

Advanced skills of testers: a guide to the application of unit test reports

The former king of fruit juice sold for 1.6 billion yuan
随机推荐
S7-1500 PLC之间进行TCP通信的具体方法和步骤详解(图文)
matlab Delaunay 三角剖分内的查询点
成长一夏 挑战赛来袭 专属社区福利来袭~免费获得CSDN定制T恤衫
2022 最新 JCR正式发布全球最新影响因子名单(前600名)
闲鱼难“翻身”
Advanced skills of testers: a guide to the application of unit test reports
笔记软件的历史、选择策略以及深度评测
Why must a digital transformation strategy include continuous testing?
WeakSet
RP原型资源分享-购物类App
Detailed explanation of specific methods and steps for TCP communication between s7-1500 PLCs (picture and text)
杭州炒股开户选择手机办理安全吗?
Final chapter of binary tree
测试人进阶技能:单元测试报告应用指南
太湖 “中国健康农产品·手机直播万里行”走进太湖
[jetsonnano] [tutorial] [introductory series] [i] how to enable VNC sharing
线下门店为什么要做新零售?
【已解决】抖音如何取消关注已注销的账户
企业中通过组策略管理Edge浏览器设置(IE模式、主页绑定等)
将 EMQX Cloud 数据通过公网桥接到 AWS IoT