Skip to content
This repository was archived by the owner on Feb 5, 2021. It is now read-only.

Commit fe88519

Browse files
author
Bin Yi
authored
Merge pull request #113 from tjamet/input/forward
Add support for forward input
2 parents 70e23ce + 7f1b8ed commit fe88519

File tree

5 files changed

+25
-2
lines changed

5 files changed

+25
-2
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ ENV K8S_METADATA_FILTER_VERIFY_SSL "true"
6262
ENV K8S_METADATA_FILTER_BEARER_CACHE_SIZE "1000"
6363
ENV K8S_METADATA_FILTER_BEARER_CACHE_TTL "3600"
6464
ENV VERIFY_SSL "true"
65+
ENV FORWARD_INPUT_BIND "0.0.0.0"
66+
ENV FORWARD_INPUT_PORT "24224"
6567

6668
COPY --from=builder /var/lib/gems /var/lib/gems
6769
COPY ./conf.d/ /fluentd/conf.d/

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Environment | Variable Description
9696
`EXCLUDE_POD_REGEX`|A regular expression for pods. Matching pods will be excluded from Sumo. The logs will still be sent to FluentD.
9797
`EXCLUDE_PRIORITY_REGEX`|A regular expression for syslog [priorities](https://en.wikipedia.org/wiki/Syslog#Severity_level). Matching priorities will be excluded from Sumo. The logs will still be sent to FluentD.
9898
`EXCLUDE_UNIT_REGEX` |A regular expression for `systemd` units. Matching units will be excluded from Sumo. The logs will still be sent to FluentD.
99-
`FLUENTD_SOURCE`|Fluentd can tail files or query `systemd`. Allowable values: `file`, `Systemd`. <br/><br/>Default: `file`
99+
`FLUENTD_SOURCE`|Fluentd can use log tail, systemd query or forward as the source, Allowable values: `file`, `systemd`, `forward`. <br/><br/>Default: `file`
100100
`FLUENTD_USER_CONFIG_DIR`|A directory of user-defined fluentd configuration files, which must be in the `*.conf` directory in the container.
101101
`FLUSH_INTERVAL` |How frequently to push logs to Sumo.<br/><br/>Default: `5s`
102102
`KUBERNETES_META`|Include or exclude Kubernetes metadata such as `namespace` and `pod_name` if using JSON log format. <br/><br/>Default: `true`
@@ -128,6 +128,8 @@ Environment | Variable Description
128128
`K8S_METADATA_FILTER_BEARER_CACHE_TTL`|Option to control the enabling of [metadata filter plugin cache_ttl](https://github.com/fabric8io/fluent-plugin-kubernetes_metadata_filter#configuration). Default: `3600`
129129
`K8S_NODE_NAME`|If set, improves [caching of pod metadata](https://github.com/fabric8io/fluent-plugin-kubernetes_metadata_filter#environment-variables-for-kubernetes) and reduces API calls.
130130
`VERIFY_SSL`|Verify ssl certificate of sumologic endpoint. Default: `true`
131+
`FORWARD_INPUT_BIND`|The bind address to listen to if using forward as `FLUENTD_SOURCE`. Default: `0.0.0.0` (all addresses)
132+
`FORWARD_INPUT_PORT`|The port to listen to if using forward as `FLUENTD_SOURCE`. Default: `24224`
131133

132134

133135
The following table show which environment variables affect which Fluentd sources.

conf.d/forward/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# placeholder

entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ if [ $# -gt 0 ] && [ "${1:0:1}" != "-" ]; then
44
else
55
cd `dirname $0`
66

7-
if [ $FLUENTD_SOURCE != file ] && [ $FLUENTD_SOURCE != systemd ]; then
7+
if ! ls /fluentd/etc/fluent.${FLUENTD_SOURCE}.conf > /dev/null; then
88
echo "Unknown source '$FLUENTD_SOURCE'"
99
if [ -e /dev/termination-log ]; then
1010
echo "Unknown source '$FLUENTD_SOURCE'" >/dev/termination-log

etc/fluent.forward.conf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## built-in TCP input
2+
## $ echo <json> | fluent-cat <tag>
3+
<source>
4+
@type forward
5+
@id forward_input
6+
port "#{ENV['FORWARD_INPUT_PORT']}"
7+
bind "#{ENV['FORWARD_INPUT_BIND']}"
8+
</source>
9+
10+
<source>
11+
@type monitor_agent
12+
bind 0.0.0.0
13+
port 24220
14+
</source>
15+
16+
@include /fluentd/conf.d/forward/source.*.conf
17+
@include /fluentd/conf.d/user/*.conf
18+
@include /fluentd/conf.d/out.sumo.conf

0 commit comments

Comments
 (0)