nginx-access.yml 1.02 KB
filebeat.prospectors:
- input_type: log
  paths:
     - /Data/logs/nginx/api.yoho.cn_access.log
  document_type: nginx_access
  fields:
      source_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
{% if dc == 'qcloud-az3' %}
      region: "az3"
{% elif dc == 'qcloud-az2' %}
      region: "az2"
{% elif dc == 'qcloud-az1' %}
      region: "az1"
{% else %}
      region: "unknown"
{% endif %}
  fields_under_root: true
  tail_files: true

- input_type: log
  paths:
     - /Data/logs/nginx/api.yoho.cn_error.log
  document_type: nginx_access_error
  fields:
      source_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
{% if dc == 'qcloud-az3' %}
      region: "az3"
{% elif dc == 'qcloud-az2' %}
      region: "az2"
{% elif dc == 'qcloud-az1' %}
      region: "az1"
{% else %}
      region: "unknown"
{% endif %}
  fields_under_root: true
  tail_files: true
  multiline.pattern: '^\d{4}'
  multiline.negate: true
  multiline.match: after


output.logstash:
  hosts: ["10.67.1.192:5044"]