zeus
3 years ago
2 changed files with 163 additions and 0 deletions
@ -0,0 +1,162 @@ |
|||
= dummy_service |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
== WriteToMongo/fluent/fluent.conf |
|||
|
|||
|
|||
[source,javascript] |
|||
---- |
|||
# config |
|||
<match debug.*> |
|||
@type stdout |
|||
</match> |
|||
|
|||
# input log |
|||
<source> |
|||
@type tail // <1> |
|||
|
|||
path /var/log/*.log |
|||
path_key tailed_path |
|||
pos_file /tmp/fluentd--1605454018.pos |
|||
pos_file_compaction_interval 30s |
|||
refresh_interval 30s |
|||
skip_refresh_on_startup |
|||
|
|||
tag stats.node |
|||
|
|||
enable_stat_watcher false |
|||
enable_watch_timer true |
|||
read_from_head true |
|||
follow_inodes true # Without this parameter, file rotation causes log duplication |
|||
|
|||
<parse> |
|||
@type none |
|||
|
|||
keep_time_key true |
|||
</parse> |
|||
</source> |
|||
|
|||
# input stats |
|||
<source> |
|||
@type tail |
|||
|
|||
path /var/log-in/*/* |
|||
path_key tailed_path |
|||
pos_file /tmp/fluentd--1605454014.pos |
|||
pos_file_compaction_interval 10s |
|||
refresh_interval 30s |
|||
skip_refresh_on_startup |
|||
|
|||
tag log.node |
|||
|
|||
enable_stat_watcher false |
|||
enable_watch_timer true |
|||
read_from_head true |
|||
follow_inodes true # Without this parameter, file rotation causes log duplication |
|||
<parse> |
|||
@type none |
|||
|
|||
keep_time_key true |
|||
</parse> |
|||
</source> |
|||
|
|||
# output mongo log* |
|||
<match log.*> |
|||
@type copy |
|||
copy_mode deep |
|||
<store ignore_error> |
|||
@type mongo |
|||
|
|||
connection_string mongodb://mongo.poc-datacollector_datacollector-net:27017/fluentdb |
|||
|
|||
#database fluentdb |
|||
collection test |
|||
#host mongo.poc-datacollector_datacollector-net |
|||
#port 27017 |
|||
|
|||
num_retries 60 |
|||
capped |
|||
capped_size 100m |
|||
<inject> |
|||
# key name of timestamp |
|||
time_key time |
|||
</inject> |
|||
|
|||
<buffer> |
|||
retry_wait 50s |
|||
flush_mode immediate |
|||
#flush_interval 10s |
|||
</buffer> |
|||
</store> |
|||
|
|||
<store ignore_error> |
|||
@type stdout |
|||
</store> |
|||
|
|||
<store ignore_error> |
|||
@type file |
|||
path /tmp/mylog |
|||
<buffer> |
|||
timekey 1d |
|||
timekey_use_utc true |
|||
timekey_wait 10s |
|||
</buffer> |
|||
</store> |
|||
|
|||
</match> |
|||
|
|||
# output mongo log* |
|||
#<match stats.*> |
|||
# @type copy |
|||
# <store> |
|||
# @type mongo |
|||
# #copy_mode shallow |
|||
# |
|||
# database fluentdb |
|||
# collection stats |
|||
# host mongo.poc-datacollector_datacollector-net |
|||
# port 27017 |
|||
# |
|||
# num_retries 60 |
|||
# capped |
|||
# capped_size 100m |
|||
# |
|||
# |
|||
# <buffer> |
|||
# flush_interval 30s |
|||
# </buffer> |
|||
# </store> |
|||
# |
|||
# <store> |
|||
# @type stdout |
|||
# </store> |
|||
# |
|||
# <store> |
|||
# @type file |
|||
# path /tmp/mylog1 |
|||
# <buffer> |
|||
# timekey 1d |
|||
# timekey_use_utc true |
|||
# timekey_wait 10s |
|||
# </buffer> |
|||
# </store> |
|||
# |
|||
#</match> |
|||
---- |
|||
<1> *localhost* inside of a container will resolve to the network stack of this container |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Loading…
Reference in new issue