fluent-plugin-xxxx

Alias

1
2
alias fluentd='/opt/td-agent/embedded/bin/fluentd'
alias fluentd-test='fluentd --dry-run -c /etc/td-agent/td-agent.conf'

test

1
fluentd-test

restart

1
service td-agent restart

fluent-plugin-grep

1
2
3
NOTE: grep filter is now a built-in plugin. Use the built-in plugin instead of installing this plugin.

Or, you may find https://github.com/sonots/fluent-plugin-filter_where is more useful.

fluent-plugin-beats

1
apt install ruby-dev rubygems
1
2
3
td-agent-gem list --all
td-agent-gem install fluent-plugin-beats --explain
td-agent-gem install fluent-plugin-beats

Forwarding over SSL

fluent-plugin-secure-forward is deprecated. use a built-in plugin in-forward tsl.

Receiver

  • generate Cert
1
2
3
cd /etc/td-agent
mkdir certs
openssl req -new -x509 -sha256 -days 1095 -newkey rsa:2048 -keyout certs/fluentd.key -out certs/fluentd.crt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<source>
@type forward
port 24224
bind 0.0.0.0
<transport tls>
version TLSv1_2
ciphers ALL:!aNULL:!eNULL:!SSLv2
insecure false

cert_path /etc/td-agent/certs/fluentd.crt
private_key_path /etc/td-agent/certs/fluentd.key
private_key_passphrase MY_PASSPHRASE
client_cert_auth false

</transport>
</source>

<match forward.**>
@type stdout
</match>

Sender

use a built-in out_forward.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<match forward.**>
@type forward
send_timeout 60s
recover_wait 10s
hard_timeout 60s
transport tls
tls_cert_path certs/fluentd.crt
tls_verify_hostname false

<server>
name myserver1
host 192.168.1.3
port 24224
weight 60
</server>

<secondary>
@type file
path /var/log/fluent/forward-failed
</secondary>
</match>

References