Last active
December 18, 2020 18:46
-
-
Save sw-samuraj/e74710a1722e2f676de3eb90ad4e8d84 to your computer and use it in GitHub Desktop.
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
## File input | |
<source> | |
@type tail | |
path /tmp/fluentd/*/cell.log | |
pos_file /tmp/fluentd/cell.log.pos | |
tag cloudsql.cell | |
read_from_head true | |
<parse> | |
@type json | |
</parse> | |
</source> | |
## Filter | |
<filter cloudsql.cell> | |
@type record_transformer | |
enable_ruby | |
<record> | |
msg ${record["msg"].encode("UTF-8", invalid: :replace, replace: "__NON_ASCII_CHAR__")} | |
timestamp ${record["ts"]} | |
</record> | |
</filter> | |
## Elasticsearch | |
<match cloudsql.cell> | |
@type elasticsearch | |
host localhost | |
port 9200 | |
index_name fluentd.${tag} | |
<buffer> | |
flush_interval 10s | |
</buffer> | |
</match> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment