ELK 의 filebeat 다 중 로그 수집 및 분할

4675 단어 elk
공식 링크: 로그 분할
#=========================== Filebeat inputs =============================
filebeat.inputs:
- type: log
  enabled: true
  paths:
    - /usr/local/gwt/nginx/logs/*access.log
  tags: ["access"]
  json.keys_under_root: true
  json.add_error_key: true

- type: log
  enabled: true
  paths:
    - /usr/local/gwt/nginx/logs/*error.log
  tags: ["error"]

#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["192.168.31.234:9200"]
  indices:
    - index: nginx-access-%{[beat.version]}-%{+yyyy.MM}
      when.contains:
        tags: "access"
    - index: nginx-error-%{[beat.version]}-%{+yyyy.MM}
      when.contains:
        tags: "error"

setup.template.name: "nginx-"
setup.template.pattern: "nginx-*"
setup.template.enabled: false
setup.template.overwrite: true

좋은 웹페이지 즐겨찾기