| 93 | |
| 94 | |
| 95 | ## Td-agent Configuration |
| 96 | |
| 97 | {{{ |
| 98 | <system> |
| 99 | log_level warn |
| 100 | </system> |
| 101 | |
| 102 | <source> |
| 103 | @type forward |
| 104 | port 24224 |
| 105 | bind 127.0.0.1 |
| 106 | </source> |
| 107 | |
| 108 | <filter docker.**> |
| 109 | @type parser |
| 110 | format multi_format |
| 111 | key_name log |
| 112 | time_parse false |
| 113 | reserve_data false |
| 114 | |
| 115 | #Match java logs |
| 116 | <pattern> |
| 117 | format /^(?<log_time>.+ .+ .+) (?<log_source>.+): \{"level":"(?<log_level>.*)","class":"(?<log_class>.*)","message":"(?<log_message>.*)"\}$/ |
| 118 | </pattern> |
| 119 | #Match default fluentd messages |
| 120 | <pattern> |
| 121 | format /^(?<log_time>.+ .+ .+) (?<log_source>.+): \{"message":"(?<log_message>.*)"\}$/ |
| 122 | </pattern> |
| 123 | #Match plain stdout messages |
| 124 | <pattern> |
| 125 | format /^(?<log_message>.*)$/ |
| 126 | </pattern> |
| 127 | </filter> |
| 128 | |
| 129 | <match *.**> |
| 130 | @type copy |
| 131 | <store> |
| 132 | @type file |
| 133 | path /var/log/fluent/aggregation |
| 134 | time_slice_format %Y%m%d |
| 135 | time_slice_wait 10m |
| 136 | time_format %Y%m%dT%H%M%S%z |
| 137 | compress gzip |
| 138 | utc |
| 139 | </store> |
| 140 | </match> |
| 141 | }}} |
| 142 | |