Filebeat 收集log

直接贴配置文件

filebeat.inputs:
  - type: log
    enabled: true
    # 开启json解析
    json.keys_under_root: true
    json.add_error_key: true
    # 日志文件路径
    paths:
      - /go_vue_admin/server/log/*/*.log
    tags: ["fawu"]
  - type: log
    enabled: true
    # 开启json解析
    json.keys_under_root: true
    json.add_error_key: true
    # 日志文件路径
    paths:
      - /ess_fawu_work/server/log/*/*.log
    tags: [ "ess" ]
##
setup.ilm.enabled: false
setup.template.settings:
  index.number_of_shards: 1

# 定义 topic field
fields:
  log_topic: log-collection

# 输出到
output.elasticsearch:
  hosts: ["http://127.0.0.1:4080"]
  path: "/es/"
  indices:
    - index: "fawu-%{[agent.version]}-%{+yyyy.MM.dd}"
      when.contains:
        tags: "fawu"
    - index: "ess-%{[agent.version]}-%{+yyyy.MM.dd}"
      when.contains:
        tags: "ess"
  # index: "fawu-log-%{+yyyy.MM.dd}"
  username: "******"
  password: "*****"

你可能感兴趣的:(elasticsearch,大数据,搜索引擎)