Skip to content

Instantly share code, notes, and snippets.

@hitenpratap
Created June 30, 2020 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hitenpratap/ec4356ae4d75a7bf5ba55f9fc906a579 to your computer and use it in GitHub Desktop.
Save hitenpratap/ec4356ae4d75a7bf5ba55f9fc906a579 to your computer and use it in GitHub Desktop.
Fluentd Config File
<source>
type tail
format multiline
format_firstline /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/
format1 /^(?<datetime>[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}) (?<Thread>\[(.*?)\]) (?<Log-Level>[A-Z]*) (?<Logger>(.+?(?=))) (?<separator>(-)) (?<message>.*)$/
path /log/application-backend-dev.log
pos_file /log/pos/application-backend-dev-multiline.pos
tag spring-boot-logs
</source>
<filter spring-boot-logs>
type record_transformer
<record>
hostname ${hostname}
</record>
</filter>
<match spring-boot-logs>
type elasticsearch
host localhost
port 9200
logstash_format true
logstash_prefix spring-boot-logs
flush_interval 5s
</match>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment