[root@node2 filebeat-8.0.1-linux-x86_64]# cat filebeat.yml
###################### Filebeat配置示例 #########################
# 此文件是一个示例配置文件,仅突出显示最常见的选项.
# 此filebeat的参考文件来自同一目录的引用文件,包含所有受支持的选项,并带有更多注释。
# 你可以把它作为参考。
# 您可以在官网找到完整的配置参考。地址:
# https://www.elastic.co/guide/en/beats/filebeat/index.html
# 更多的模块和选项,参考实例文件
# ============================== Filebeat inputs ===============================
filebeat.inputs:
# 每个 - 都是一个输入。输入的时候可以设置很多选项
# 因此,您可以对各种配置使用不同的输入。
# 下面是一个特定的输入配置。
# filestream是一个从文件中收集日志消息的入口。
- type: filestream # 类型:filestream
# 更改为true以启用此输入配置.
enabled: false
# 设置路径,可以设置好几个,绝对路径。
paths:
- /var/log/*.log
#- c:\programdata\elasticsearch\logs\*
# 排除行.
# 要匹配的正则表达式列表。 它会从列表中删除与任何正则表达式匹配的行。
#exclude_lines: ['^DBG']
# 包括行.
# 要匹配的正则表达式列表。它导出与列表中任何正则表达式匹配的行。
#include_lines: ['^ERR', '^WARN']
# 排除文件。
# 要匹配的正则表达式列表。 Filebeat会从列表中删除与任何正则表达式匹配的文件。
#
# 默认情况下,不会删除任何文件。
#prospector.scanner.exclude_files: ['.gz$']
# 可选的附加字段。
# 可以自由选择这些字段,将附加信息添加到收集日志文件中进行过滤。
#fields:
# level: debug
# review: 1
# ============================== Filebeat模块 ==============================
filebeat.config.modules:
# 配置加载的全局模式
path: ${path.config}/modules.d/*.yml
# 设置为true以启用配置重新加载
reload.enabled: false
# 检查路径下文件的更改的时间段
#reload.period: 10s
# ======================= Elasticsearch模板设置 =======================
setup.template.settings:
index.number_of_shards: 1
#index.codec: best_compression
#_source.enabled: false
# ================================== General(通用) ===================================
# 推送数据者,可以用于在web界面中对单个发货人发送的所有交易进行分组。
#name:
# 每次发布交易时,发货人的标签都会包含在自己的字段中。
#tags: ["service-X", "web-tier"]
# 可选字段,可以指定这些字段向输出中添加其他信息。
#fields:
# env: staging
# ================================= Dashboards (仪表板)=================================
# 这些设置控制将示例仪表板加载到Kibana索引。
# 默认情况下,加载仪表板是禁用的,可以通过在此处设置选项或使用“setup”命令来启用。
#setup.dashboards.enabled: false
# 从何处下载仪表盘存档的URL。
# 默认情况下,此URL有一个基于节拍名称和版本计算的值。对于已发布的版本,此URL指向工件上的仪表板存档。有弹力的联合网站。
#setup.dashboards.url:
# =================================== Kibana ===================================
# 从Beats 6.0.0版开始,仪表盘通过Kibana API加载。
# 这需要Kibana端点配置。
setup.kibana:
# Kibana Host
# 方案和端口可以省略,并将设置为默认值(http端口:5601)
# 如果指定了其他路径,则需要该方案:http://localhost:5601/path
# IPv6地址应始终定义为:https://[2001:db8::1]:5601
#host: "localhost:5601"
# Kibana Space ID
# 仪表板应装入的Kibana空间的ID。 默认情况下,将使用默认空间。
#space.id:
# =============================== Elastic Cloud(用不到) ================================
# 这些设置简化了将Filebeat与弹性云结合使用的过程(https://cloud.elastic.co/).
# The cloud.id setting overwrites the `output.elasticsearch.hosts` and
# `setup.kibana.host` options.
# You can find the `cloud.id` in the Elastic Cloud web UI.
#cloud.id:
# The cloud.auth setting overwrites the `output.elasticsearch.username` and
# `output.elasticsearch.password` settings. The format is `<user>:<pass>`.
#cloud.auth:
# ================================== Outputs ===================================
# 配置所收集的数据在发送时使用的输出。
# ---------------------------- Elasticsearch Output ----------------------------
output.elasticsearch:
# 要连接到的主机阵列。
hosts: ["localhost:9200"]
# 协议-http(默认)或https。
#protocol: "https"
# 身份验证凭据-API密钥或用户名/密码。
#api_key: "id:api_key"
#username: "elastic"
#password: "changeme"
# ------------------------------ Logstash Output -------------------------------
#output.logstash:
# Logstash主机
#hosts: ["localhost:5044"]
# 可选SSL。默认情况下是关闭的。
# List of root certificates for HTTPS server verifications
#ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]
# Certificate for SSL client authentication
#ssl.certificate: "/etc/pki/client/cert.pem"
# Client Certificate Key
#ssl.key: "/etc/pki/client/cert.key"
# ================================= Processors =================================
processors:
- add_host_metadata:
when.not.contains.tags: forwarded
- add_cloud_metadata: ~
- add_docker_metadata: ~
- add_kubernetes_metadata: ~
# ================================== Logging ===================================
# Sets log level. The default log level is info.
# Available log levels are: error, warning, info, debug
#logging.level: debug
# At debug level, you can selectively enable logging only for some components.
# To enable all selectors use ["*"]. Examples of other selectors are "beat",
# "publisher", "service".
#logging.selectors: ["*"]
# ============================= X-Pack Monitoring(收费,不看) ==============================
# Filebeat can export internal metrics to a central Elasticsearch monitoring
# cluster. This requires xpack monitoring to be enabled in Elasticsearch. The
# reporting is disabled by default.
# Set to true to enable the monitoring reporter.
#monitoring.enabled: false
# Sets the UUID of the Elasticsearch cluster under which monitoring data for this
# Filebeat instance will appear in the Stack Monitoring UI. If output.elasticsearch
# is enabled, the UUID is derived from the Elasticsearch cluster referenced by output.elasticsearch.
#monitoring.cluster_uuid:
# Uncomment to send the metrics to Elasticsearch. Most settings from the
# Elasticsearch output are accepted here as well.
# Note that the settings should point to your Elasticsearch *monitoring* cluster.
# Any setting that is not set is automatically inherited from the Elasticsearch
# output configuration, so if you have the Elasticsearch output configured such
# that it is pointing to your Elasticsearch monitoring cluster, you can simply
# uncomment the following line.
#monitoring.elasticsearch:
# ============================== Instrumentation(插件) ===============================
# filebeat支持的插件.
#instrumentation:
# 设置为true以启用filebeat的检测。
#enabled: false
# 运行filebeat的环境(例如:暂存、生产等)
#environment: ""
# 向APM服务器主机报告检测结果。
#hosts:
# - http://localhost:8200
# APM服务器的API密钥。
# 如果设置了api_密钥,则将忽略机密_令牌。
#api_key:
# APM服务器的秘密令牌。
#secret_token:
# ================================= Migration(迁移) ==================================
# 允许启用6.7迁移别名
#migration.6_to_7.enabled: true