| {% from "fluentd/map.jinja" import server with context %} |
| |
| {%- for config in server.config %} |
| |
| {%- if config.type == "input" and config.name =="forward" %} |
| <source> |
| type forward |
| port {{ config.bind.port }} |
| bind {{ config.bind.host }} |
| </source> |
| {%- endif %} |
| {%- if config.type == "output" and config.name == "elasticsearch" %} |
| <match *> |
| port {{ config.bind.port }} |
| bind {{ config.bind.host }} |
| type elasticsearch |
| logstash_format true |
| flush_interval 10s # for testing |
| </match> |
| {%- endif %} |
| {%- if config.type == "output" and config.name == "mongodb" %} |
| <match *> |
| # plugin type |
| type mongo |
| |
| # mongodb db + collection |
| database apache |
| collection access |
| |
| # mongodb host + port |
| host localhost |
| port 27017 |
| |
| # interval |
| flush_interval 10s |
| </match> |
| {%- endif %} |
| |
| {%- endfor %} |
| |
| <source> |
| type syslog |
| port 42185 |
| tag syslog |
| </source> |
| |
| <source> |
| type tail |
| format apache2 |
| path /var/log/httpd/kibana_kibana.access.log |
| pos_file /var/log/td-agent/kibana_kibana.access_log.pos |
| tag mongo.apache.access |
| </source> |