configmap-fluentd.yaml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: fluentd-configmap-sidecar
  5. namespace: {{ .Values.namespace }}
  6. data:
  7. fluent.conf: |-
  8. @include system.conf
  9. @include source.containers.conf
  10. @include source.files.conf
  11. @include source.journald.conf
  12. @include monit.conf
  13. @include output.conf
  14. @include prometheus.conf
  15. output.conf: |-
  16. #Events are emitted to the CONCAT label from the container, file and journald sources for multiline processing.
  17. <label @CONCAT>
  18. # = output =
  19. <match **>
  20. @type splunk_hec
  21. protocol https
  22. hec_host "51.250.7.127"
  23. hec_port 8088
  24. hec_token "#{ENV['SPLUNK_HEC_TOKEN']}"
  25. insecure_ssl true
  26. host "my-cluster"
  27. <buffer>
  28. @type memory
  29. chunk_limit_records 100000
  30. chunk_limit_size 20m
  31. flush_interval 5s
  32. flush_thread_count 1
  33. overflow_action block
  34. retry_max_times 5
  35. retry_type periodic
  36. total_limit_size 600m
  37. </buffer>
  38. <format monitor_agent>
  39. @type json
  40. </format>
  41. <format>
  42. # we just want to keep the raw logs, not the structure created by docker or journald
  43. @type single_value
  44. message_key log
  45. add_newline false
  46. </format>
  47. </match>
  48. </label>
  49. source.files.conf: |-
  50. # This fluentd conf file contains sources for log files other than container logs.
  51. <source>
  52. @id tail.file.my-log-file
  53. @type tail
  54. @label @CONCAT
  55. tag tail.file.my-log-file
  56. path /opt/uptycs/logs/*.log
  57. pos_file /opt/uptycs/logs/splunk-fluentd-containers.log.pos
  58. read_from_head true
  59. path_key source
  60. <parse>
  61. @type none
  62. message_key log
  63. </parse>
  64. </source>
  65. system.conf: |-
  66. # system wide configurations
  67. <system>
  68. log_level info
  69. root_dir /tmp/fluentd
  70. </system>