filebeat.yml.j2 928 B

123456789101112131415161718192021222324252627282930
  1. setup.ilm.enabled: false
  2. setup.template.enabled: true
  3. setup.template.name: "{{ansible_hostname}}-log"
  4. setup.template.pattern: "{{ansible_hostname}}-log-*"
  5. setup.template.overwrite: true
  6. filebeat.inputs:
  7. - type: log
  8. enabled: true
  9. paths:
  10. - /var/log/auth.log
  11. - /var/log/caddy.access.log
  12. - /var/log/messages
  13. - /usr/local/etc/unbound/unbound.log
  14. json.add_error_key: true # Add an error key if JSON parsing fails
  15. processors:
  16. - decode_json_fields:
  17. fields: ["msg"] # Parse the "msg" field (assuming it's a string containing JSON)
  18. target: "msg" # The parsed output will be under a new field "msg_parsed"
  19. overwrite_keys: true # Optionally overwrite the "msg" field
  20. output.elasticsearch:
  21. hosts: ["http://log.service:5080"]
  22. timeout: 10
  23. path: "/api/default/"
  24. index: default
  25. username: "openobserve@unbl.ink"
  26. password: "{{openobserve_password}}"