Created
June 11, 2021 07:53
-
-
Save Insidexa/a45a34d32fa07c756f2fb5c592205471 to your computer and use it in GitHub Desktop.
fluentd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<source> | |
@type forward | |
port 24224 | |
bind 0.0.0.0 | |
<parse> | |
@type "json" | |
</parse> | |
time_format %Y-%m-%dT%H:%M:%S.%L | |
</source> | |
<filter **> | |
@type parser | |
key_name "log" | |
reserve_data true | |
reserve_time true | |
hash_value_field "parsed" | |
remove_key_name_field false | |
replace_invalid_sequence true | |
emit_invalid_record_to_error false | |
<parse> | |
@type "json" | |
</parse> | |
</filter> | |
<match *.**> | |
@type copy | |
<store> | |
@type elasticsearch | |
host "#{ENV['ES_HOST']}" | |
port "#{ENV['ES_PORT']}" | |
user "#{ENV['ES_USER']}" | |
password "#{ENV['ES_PASS']}" | |
scheme https | |
logstash_format true | |
logstash_prefix "fluentd" | |
logstash_dateformat %Y-%m-%d | |
include_tag_key true | |
type_name access_log | |
tag_key @log_name | |
<buffer> | |
flush_mode interval | |
flush_interval 5s | |
</buffer> | |
</store> | |
<store> | |
@type stdout | |
</store> | |
</match> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment