filebeat.yml 全部配置如下,支持对日志内容的 json 进行解析,可直接使用。测试日志如{"host_ip":"127.0.0.1","res-time":"2019-11-03 17:17:32.715","create_time":"2019-11-03T17:17:32.715+0800","res-key":0,"uuid":"","business_id":"test-random"}
###################### Filebeat Configuration Example #########################
# This file is an example configuration file highlighting only the most common
# options. The filebeat.reference.yml file from the same directory contains all the
# supported options with more comments. You can use it as a reference.
#
# You can find the full configuration reference here:
# https://www.elastic.co/guide/en/beats/filebeat/index.html
# For more available modules and options, please see the filebeat.reference.yml sample
# configuration file.
#=========================== Filebeat inputs =============================
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:
# - /home/elsearch/work/logs/*_filebeat.log
- /home/leon/work/tools/gtgjx_leon/logs/*_filebeat.log
#- c:\programdata\elasticsearch\logs\*
fields:
index: 'logsleon'
json.keys_under_root: true
json.overwrite_keys: true
- type: log
# Change to true to enable this input configuration.
enabled: true
# Paths that should be crawled and fetched. Glob based paths.
paths:
#- /var/log/*.log
- /home/elsearch/work/logs/*_filebeat.log
#- /home/leon/work/tools/gtgjx_leon/logs/*_filebeat.log
#- c:\programdata\elasticsearch\logs\*
# Exclude lines. A list of regular expressions to match. It drops the lines that are
# matching any regular expression from the list.
#exclude_lines: ['^DBG']
# Include lines. A list of regular expressions to match. It exports the lines that are
# matching any regular expression from the list.
#include_lines: ['^ERR', '^WARN']
# Exclude files. A list of regular expressions to match. Filebeat drops the files that
# are matching any regular expression from the list. By default, no files a