Quantcast
Channel: Fluentd Blog
Viewing all 163 articles
Browse latest View live

Fluentd v1.10.3 has been released

$
0
0

Hi users!

We have released v1.10.3. ChangeLog is here. This release fixes several bugs.

record accessor helper: Support set method

This feature is for record mutation in the plugin. Here is code example:

record = {'key1' => {'key2' => "value"}}

accessor = record_accessor_create("$['key1']['key2']")
accessor.set(r, "new value!") # record is {'key1' => {'key2' => "new value!"}} 

config: Ruby DSL format is now deprecated

We decided to deprecate experimental Ruby DSL configuration by following reasons:

  • Hard to maintain full configuation features
  • Hard to implement/parse in other system

Major bug fixes

  • outforward: Disable `lingertimeout` setting on Windows
  • service discovery: Fix warning of service discovery manager when fluentd stops

Enjoy logging!


Fluentd v1.10.4 has been released

$
0
0

Hi users!

We have released v1.10.4. ChangeLog is here. This release fixes several bugs.

out_http: Support single json array payload

out_http uses ndjson for json payload by default.

{"key":"value1"}
{"key":"value2"}
...
{"key":"valueN"}

You can change payload format to single json array by setting json_array true.

# conf
<match pattern>
  @type http
  # other parameters...
  json_array true
  <format>
    @type json
    add_newline false
  </format>
</match>

# payload
[{"key":"value1"},{"key":"value2"},...,{"key":"valueN"}]

Major bug fixes

  • supervisor: Call File.umask(0) for standalone worker
  • out_forward: Fix ZeroDivisionError issue with weight 0

Enjoy logging!

Fluentd v1.11.0 has been released

$
0
0

Hi users!

We have released v1.11.0. ChangeLog is here.

in_unix: Use v1 API

Migrate to v1 plugin API.

In addition, in_unix now supports tag parameter to use fixed tag.

Improve syslog parser

There are several improvements:

  • Improve message_format auto performance by avoiding object allocation
  • Support any time_format for RFC3164 with parser_type string
  • Support parser_type string for RFC5424. This parser is 2x faster than parser_type regexp

We now recommend to use parser_type string for both RFC3164 and RFC5424.

Major bug fixes

  • in_gc_stat: Add use_symbol_keys parameter to support non-stdout plugin.

Enjoy logging!

Fluentd v1.11.1 has been released

$
0
0

Hi users!

We have released v1.11.1. ChangeLog is here.

in_http: Improve time field handling

in_http now supports time parsing in record field for default json/msgpack request. Here is configuration example:

<source>
  @type http
  @id input_http
  port 8888
  <parse>
    time_format %iso8601
    time_key logtime
    keep_time_key true
  </parse>
</source>

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

If you post following requests:

# ruby code example

require 'net/http'
require 'json'

record  = {'json' => {'k' => 'hello1', 'logtime' => '2020-06-10T11:14:27+09:00'}.to_json}
records = {'json' => [
  {'k' => 'hello2', 'logtime' => '2020-06-10T11:14:28+09:00'},
  {'k' => 'hello3', 'logtime' => '2020-06-10T11:14:29+09:00'}
].to_json}

def post(path, params)
  http = Net::HTTP.new('127.0.0.1', 8888)
  req  = Net::HTTP::Post.new(path, {})
  req.set_form_data(params)
  http.request(req)
end

post("/test.http", record)
post("/test.http", records)

the log shows expected result:

2020-06-10 11:14:27.000000000 +0900 test.http: { "k":"hello1","logtime":"2020-06-10T11:14:27+09:00"}
2020-06-10 11:14:28.000000000 +0900 test.http: { "k":"hello2","logtime":"2020-06-10T11:14:28+09:00"}
2020-06-10 11:14:29.000000000 +0900 test.http: { "k":"hello3","logtime":"2020-06-10T11:14:29+09:00"}

Before, this configuration doesn't work because in_http assumes the time value is floating point.

Major bug fixes

  • in_tail: Use actual path instead of base pattern for ignore list
  • child_process helper: Fix child process failure due to SIGPIPE if the command uses stdout

Enjoy logging!

Fluentd v1.11.2 has been released

$
0
0

Hi users!

We have released v1.11.2. ChangeLog is here.

Allow regular expression in filter/match tag matching

Regular expression, /pattern/, is now allowed in tag matching:

<source>
  @type forward
</source>

# For a.xxx tag
<filter a.**>
  @type record_transformer
  <record>
    new_key a-started tag record
  </record>
</filter>

# For non a.xxx tag like b.xxx/c.xxx/...
<filter /(?!a\.).*/>
  @type record_transformer
  <record>
    new_key other tag record
  </record>
</filter>

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

If you send following events:

% echo '{"msg":"hi"}' | fluent-cat a.foo
% echo '{"msg":"hi"}' | fluent-cat b.foo

the log shows:

2020-08-06 13:40:03.111196000 +0900 a.foo: {"msg":"hi","new_key":"a-started tag record"}
2020-08-06 13:40:09.492380000 +0900 b.foo: {"msg":"hi","new_key":"other tag record"}

Of course, simple data pipeline is important for robust log collection. If you need this feature, check your configuration/data flow first.

in_dummy is renamed in_sample

We recommend to use sample instead of dummy:

<source>
  @type sample
  sample {"hello":"world"}
</source>

# If you use fluentd v1.11.1 or earlier, use following configuration
# Fluentd v2 will remove old configuration support
<source>
  @type dummy
  dummy {"hello":"world"}
</source>

Major bug fixes

  • buffer: Fix log message for chunk_limit_records case
  • buffer: Fix timekey optimization for non-windows platform
  • cert: Raise an error for broken certificate file
  • cert: Set TLS ciphers list correcty on older OpenSSL, e.g. openssl v1.0.2

Enjoy logging!

Fluentd v1.11.3 has been released

$
0
0

Hi users!

We have released v1.11.3. ChangeLog is here.

log: Add ignore_same_log_interval parameter

Fluentd has ignore_repeated_log_interval parameter but this is not enough for some frequent log generation case. For example, if the plugin generates several log messages in one action, logs are not repeated:

# retry generates same error messages with ignore_repeated_log_interval
def write(chunk)
  # process 1...
  log.error "message1"
  # process 2...
  log.error "message2"
end

ignore_same_log_interval resolves these cases. With this option, logger keeps to store all log messages for validation.

<system>
  ignore_same_log_interval 60s
</system>

inexec: Add `connectmode` parameter to read stderr

in_exec doesn't read stderr and this is not good for script debug. To resolve this problem, add connect_mode parameter to read stderr logs.

<source>
  @type exec
  tag somescript
  command python /path/to/script.py
  connect_mode read_with_stderr
  <parse>
    @type none
  </parse>
</source>

Major bug fixes

  • buffer: Fix calculation of timekey stats
  • buffer: fix binmode usage for prevent gc

Enjoy logging!

Fluentd Ecosystem Survey 2020

$
0
0

Hey All,

Thank you for being part of the Fluent Slack Community! As part of improving Fluentd and Fluent Bit, we want to know what pains and feedback you are experiencin to better manage our future together.

We have created an anonymous survey that allows you to share this here.



Optionally, if you are interested you can add your email to give us direct feedback. Looking forward to your feedbacks!

Fluentd v1.11.5 has been released

$
0
0

Hi users!

We have released v1.11.5. ChangeLog is here.

formatter: Provide newline parameter to support CRLF

This parameter is for Windows environment. Users can choose LF or CRLF newline for add_newline true case.

newline lf # or crlf

out_http: adding support for intermediate certificates

Add support for sending a client certificate chain for mutual TLS authentication in the HTTP output plugin.

Major bug fixes

  • Fix a bug that windows service isn't stopped gracefuly

Enjoy logging!


Fluentd v1.12.0 has been released

$
0
0

Hi users!

We have released v1.12.0. ChangeLog is here.

in_tail: Support * in path with log rotation

fluentd v1.12.0 resolves the limitation for * with log rotation. follow_inodes true enables the combination of * in path with log rotation inside same directory and read_from_head true without log duplication problem.

path /path/to/*
read_from_head true
follow_inodes true  # without this parameter, log rotation may cause log duplication

in_tail: Support Linux Capability

Fluentd supports Linux capability via capng_c gem and in_tail now supports CAP_DAC_READ_SEARCH/CAP_DAC_OVERRIDE capabilities to read log files.

See official article for more details: Linux Capability

If you want more capability support in official plugins, file it on github.

Add fluent-ctl command

fluent-ctl provides same interface to control fluentd process, shutdown/restart/flush/reload.

  • On Linux, fluent-ctl uses Signals
  • On Windows, fluent-ctl uses Windows Event

Command example:

# Usage: fluent-ctl action PID
$ fluent-ctl shutdown 11111

Major bug fixes

  • output: Prevent retry.step from being called too many times in a short time

Enjoy logging!

Upgrade td-agent from v3 to v4

$
0
0

td-agent “v4” is available since August 2020. You' might’ve been wondering what the upgrade process is. You are in a right place, In this post, we will share the steps we’ve tested and hopefully this will help your experience from v3 to v4.

Differences between td-agent v3 and v4

In the td-agent v4, core components like ruby(2.4 -> 2.7) and jemalloc(4.5.0 -> 5.2.1) were updated as well as removing libraries for 3rd party gems like postgreSQL to improve the maintainability of packages.

Upgrade steps

During the upgrade process, plugins bundled in td-agent are automatically upgraded. With that being said, other plugins added on your own are not included. You should review if you need to upgrade plugins since some directory structures from v3 and v4 are changed. In this post, I will show steps with plugins added on my own, “fluent-plugin-mongo“ for instance. Here is sample configuration file I used through steps.

[root@fluent02 ~]# cat /etc/td-agent/td-agent.conf
<source>
        @type syslog
        port 5140
        bind 0.0.0.0
        tag system
</source>

<match system.**>
        @type copy
        <store>
                @type stdout
        </store>
        <store>
                @type mongo
                database rsyslog
                collection system
                host 127.0.0.1
                port 27017
        </store>
</match>

1. Review what plugins are installed together with td-agent v3.

[root@fluent02 ~]# td-agent-gem list | grep fluent-plugin*
    fluent-plugin-elasticsearch (4.0.9)
    fluent-plugin-kafka (0.13.0)
    fluent-plugin-mongo (1.5.0)
    fluent-plugin-prometheus (1.8.0)
    fluent-plugin-prometheus_pushgateway (0.0.2)
    fluent-plugin-record-modifier (2.1.0)
    fluent-plugin-rewrite-tag-filter (2.3.0)
    fluent-plugin-s3 (1.3.2)
    fluent-plugin-systemd (1.0.2)
    fluent-plugin-td (1.1.0)
    fluent-plugin-td-monitoring (0.2.4)
    fluent-plugin-webhdfs (1.2.5)

You can also find installed plugins under “/opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/“ directories. [root@fluent02 ~]# ll /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/ | grep fluent-plugin* drwxrwxr-x. 5 root root 4096 Dec 2 06:17 fluent-plugin-elasticsearch-4.0.9 drwxrwxr-x. 3 root root 169 Dec 2 06:17 fluent-plugin-kafka-0.13.0 drwxr-xr-x. 5 root root 209 Dec 2 06:54 fluent-plugin-mongo-1.5.0 drwxrwxr-x. 5 root root 195 Dec 2 06:17 fluent-plugin-prometheus-1.8.0 drwxrwxr-x. 6 root root 206 Dec 2 06:17 fluent-plugin-prometheus_pushgateway-0.0.2 drwxrwxr-x. 3 root root 161 Dec 2 06:17 fluent-plugin-record-modifier-2.1.0 drwxrwxr-x. 3 root root 210 Dec 2 06:17 fluent-plugin-rewrite-tag-filter-2.3.0 drwxrwxr-x. 3 root root 222 Dec 2 06:17 fluent-plugin-s3-1.3.2 drwxrwxr-x. 3 root root 49 Dec 2 06:17 fluent-plugin-systemd-1.0.2 drwxrwxr-x. 3 root root 236 Dec 2 06:17 fluent-plugin-td-1.1.0 drwxrwxr-x. 4 root root 152 Dec 2 06:17 fluent-plugin-td-monitoring-0.2.4 drwxrwxr-x. 3 root root 176 Dec 2 06:17 fluent-plugin-webhdfs-1.2.5

2. Stop td-agent v3 daemon.

[root@fluent02 ~]# systemctl stop td-agent

3. Run installation script of td-agent v4.

When RedHat, you can run following script. [root@fluent02 ~]# curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent4.sh | sh

You can find more information about the installation script in Fluend Doc - Installation.

4. Confirm if td-agent v4 is properly installed.

[root@fluent02 ~]# yum info td-agent
Installed Packages
Name : td-agent
Version : 4.0.1
Release : 1.el8
Architecture : x86_64
Size : 59 M
Source : td-agent-4.0.1-1.el8.src.rpm
Repository : @System
From repo : treasuredata
Summary : The stable distribution of Fluentd
URL : https://www.treasuredata.com/
License : ASL 2.0
Description : The stable distribution of Fluentd, called td-agent.

5. Reload td-agent daemon.

[root@fluent02 ~]# systemctl daemon-reload

6. Check installed plugins.

[root@fluent02 ~]# td-agent-gem list | grep fluent-plugin*
    fluent-plugin-elasticsearch (4.1.1)
    fluent-plugin-kafka (0.14.1)
    fluent-plugin-prometheus (1.8.2)
    fluent-plugin-prometheus_pushgateway (0.0.2)
    fluent-plugin-record-modifier (2.1.0)
    fluent-plugin-rewrite-tag-filter (2.3.0)
    fluent-plugin-s3 (1.4.0)
    fluent-plugin-systemd (1.0.2)
    fluent-plugin-td (1.1.0)
    fluent-plugin-webhdfs (1.2.5)

You can see bundled plugins are upgraded as well but can not find plugins added on my own. In this post, added plugin was “fluent-plugin-mongo“ and it is not shown in installed list.

7. Install plugins added on my own.

[root@fluent02 ~]# td-agent-gem install fluent-plugin-mongo

[root@fluent02 ~]# td-agent-gem list | grep fluent-plugin*
    fluent-plugin-elasticsearch (4.1.1)
    fluent-plugin-kafka (0.14.1)
    fluent-plugin-mongo (1.5.0)
    fluent-plugin-prometheus (1.8.2)
    fluent-plugin-prometheus_pushgateway (0.0.2)
    fluent-plugin-record-modifier (2.1.0)
    fluent-plugin-rewrite-tag-filter (2.3.0)
    fluent-plugin-s3 (1.4.0)
    fluent-plugin-systemd (1.0.2)
    fluent-plugin-td (1.1.0)
    fluent-plugin-webhdfs (1.2.5)

As for td-agent v4, “fluent-plugin-mongo“ was installed under “/opt/td-agent/lib/ruby/gems/2.7.0/gems/” directories.

[root@fluent02 ~]# ll /opt/td-agent/lib/ruby/gems/2.7.0/gems/ | grep fluent-plugin*
drwxr-xr-x. 5 root root 4096 Dec 2 08:26 fluent-plugin-elasticsearch-4.1.1
drwxr-xr-x. 3 root root 169 Dec 2 08:26 fluent-plugin-kafka-0.14.1
drwxr-xr-x. 5 root root 209 Dec 2 08:36 fluent-plugin-mongo-1.5.0
drwxr-xr-x. 4 root root 200 Dec 2 08:26 fluent-plugin-prometheus-1.8.2
drwxr-xr-x. 6 root root 206 Dec 2 08:26 fluent-plugin-prometheus_pushgateway-0.0.2
drwxr-xr-x. 3 root root 161 Dec 2 08:26 fluent-plugin-record-modifier-2.1.0
drwxr-xr-x. 3 root root 210 Dec 2 08:26 fluent-plugin-rewrite-tag-filter-2.3.0
drwxr-xr-x. 3 root root 222 Dec 2 08:26 fluent-plugin-s3-1.4.0
drwxr-xr-x. 3 root root 49 Dec 2 08:26 fluent-plugin-systemd-1.0.2
drwxr-xr-x. 3 root root 236 Dec 2 08:26 fluent-plugin-td-1.1.0
drwxr-xr-x. 3 root root 176 Dec 2 08:26 fluent-plugin-webhdfs-1.2.5

8. Start td-agent v4 daemon.

[root@fluent02 ~]# systemctl start td-agent

9. Check if there are no error messages in tg-agent logs.

[root@fluent02 ~]# tail -100f /var/log/td-agent/td-agent.log

10. As for my sample configuration, I restart “sshd“ service for instance and see messages are stored in MongoDB as expected.

i) Restart “sshd“ daemon.

[root@fluent02 mongo]# systemctl restart sshd

ii) Confirm messages in “stdout“ output.

[root@fluent02 ~]# tail -100f /var/log/td-agent/td-agent.log

---------- Sample message ----------
2020-12-02 08:50:29.000000000 +0000 system.authpriv.info: {"host":"fluent02","ident":"sshd","pid":"2960","message":"Server listening on :: port 22."}

iii) Create sample script to read data from MongoDB.

[root@fluent02 mongo]# vim mongo_test.py
from pymongo import MongoClient
from bson.json_util import loads, dumps
import json

client = MongoClient('localhost', 27017)
db = client.rsyslog
collection = db.system
f = collection.find()
json_str = dumps(f)
print(json_str)

iv) Run sample script and confirm if same messages with “stdout“ are available.

[root@fluent02 mongo]# python3 mongo_test.py | jq

---------- Sample message ----------
    {
        "_id": {
            "$oid": "5fc7559b0bf9f80b84137e1f"
        },
            "host": "fluent02",
            "ident": "sshd",
            "pid": "2960",
            "message": "Server listening on :: port 22.",
            "time": {
                "$date": 1606899029000
            }
        }
    }

Now, upgrading steps are completed. Happy Logging!

This blog was originally written by kubotat in the Fluentd Subscription Network.

Upgrade td-agent from v3 to v4

$
0
0

td-agent “v4” is available since August 2020. You' might’ve been wondering what the upgrade process is. You are in a right place, In this post, we will share the steps we’ve tested and hopefully this will help your experience from v3 to v4.

Differences between td-agent v3 and v4

In the td-agent v4, core components like ruby(2.4 -> 2.7) and jemalloc(4.5.0 -> 5.2.1) were updated as well as removing libraries for 3rd party gems like postgreSQL to improve the maintainability of packages.

Upgrade steps

During the upgrade process, plugins bundled in td-agent are automatically upgraded. With that being said, other plugins added on your own are not included. You should review if you need to upgrade plugins since some directory structures from v3 and v4 are changed. In this post, I will show steps with plugins added on my own, “fluent-plugin-mongo“ for instance. Here is sample configuration file I used through steps.

[root@fluent02 ~]# cat /etc/td-agent/td-agent.conf
<source>
  @type syslog
  port 5140
  bind 0.0.0.0
  tag system
</source>

<match system.**>
  @type copy
  <store>
    @type stdout
  </store>
  <store>
    @type mongo
    database rsyslog
    collection system
    host 127.0.0.1
    port 27017
  </store>
</match>

1. Review what plugins are installed together with td-agent v3.

[root@fluent02 ~]# td-agent-gem list | grep fluent-plugin*
    fluent-plugin-elasticsearch (4.0.9)
    fluent-plugin-kafka (0.13.0)
    fluent-plugin-mongo (1.5.0)
    fluent-plugin-prometheus (1.8.0)
    fluent-plugin-prometheus_pushgateway (0.0.2)
    fluent-plugin-record-modifier (2.1.0)
    fluent-plugin-rewrite-tag-filter (2.3.0)
    fluent-plugin-s3 (1.3.2)
    fluent-plugin-systemd (1.0.2)
    fluent-plugin-td (1.1.0)
    fluent-plugin-td-monitoring (0.2.4)
    fluent-plugin-webhdfs (1.2.5)

You can also find installed plugins under /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/ directories.

[root@fluent02 ~]# ll /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/ | grep fluent-plugin*
drwxrwxr-x. 5 root root 4096 Dec 2 06:17 fluent-plugin-elasticsearch-4.0.9
drwxrwxr-x. 3 root root 169 Dec 2 06:17 fluent-plugin-kafka-0.13.0
drwxr-xr-x. 5 root root 209 Dec 2 06:54 fluent-plugin-mongo-1.5.0
drwxrwxr-x. 5 root root 195 Dec 2 06:17 fluent-plugin-prometheus-1.8.0
drwxrwxr-x. 6 root root 206 Dec 2 06:17 fluent-plugin-prometheus_pushgateway-0.0.2
drwxrwxr-x. 3 root root 161 Dec 2 06:17 fluent-plugin-record-modifier-2.1.0
drwxrwxr-x. 3 root root 210 Dec 2 06:17 fluent-plugin-rewrite-tag-filter-2.3.0
drwxrwxr-x. 3 root root 222 Dec 2 06:17 fluent-plugin-s3-1.3.2
drwxrwxr-x. 3 root root 49 Dec 2 06:17 fluent-plugin-systemd-1.0.2
drwxrwxr-x. 3 root root 236 Dec 2 06:17 fluent-plugin-td-1.1.0
drwxrwxr-x. 4 root root 152 Dec 2 06:17 fluent-plugin-td-monitoring-0.2.4
drwxrwxr-x. 3 root root 176 Dec 2 06:17 fluent-plugin-webhdfs-1.2.5

2. Stop td-agent v3 daemon.

[root@fluent02 ~]# systemctl stop td-agent

3. Run installation script of td-agent v4.

When RedHat, you can run following script.

[root@fluent02 ~]# curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent4.sh | sh

You can find more information about the installation script in Fluend Doc - Installation.

4. Confirm if td-agent v4 is properly installed.

[root@fluent02 ~]# yum info td-agent
Installed Packages
Name : td-agent
Version : 4.0.1
Release : 1.el8
Architecture : x86_64
Size : 59 M
Source : td-agent-4.0.1-1.el8.src.rpm
Repository : @System
From repo : treasuredata
Summary : The stable distribution of Fluentd
URL : https://www.treasuredata.com/
License : ASL 2.0
Description : The stable distribution of Fluentd, called td-agent.

5. Reload td-agent daemon.

[root@fluent02 ~]# systemctl daemon-reload

6. Check installed plugins.

[root@fluent02 ~]# td-agent-gem list | grep fluent-plugin*
    fluent-plugin-elasticsearch (4.1.1)
    fluent-plugin-kafka (0.14.1)
    fluent-plugin-prometheus (1.8.2)
    fluent-plugin-prometheus_pushgateway (0.0.2)
    fluent-plugin-record-modifier (2.1.0)
    fluent-plugin-rewrite-tag-filter (2.3.0)
    fluent-plugin-s3 (1.4.0)
    fluent-plugin-systemd (1.0.2)
    fluent-plugin-td (1.1.0)
    fluent-plugin-webhdfs (1.2.5)

You can see bundled plugins are upgraded as well but can not find plugins added on my own. In this post, added plugin was “fluent-plugin-mongo“ and it is not shown in installed list.

7. Install plugins added on my own.

[root@fluent02 ~]# td-agent-gem install fluent-plugin-mongo

[root@fluent02 ~]# td-agent-gem list | grep fluent-plugin*
    fluent-plugin-elasticsearch (4.1.1)
    fluent-plugin-kafka (0.14.1)
    fluent-plugin-mongo (1.5.0)
    fluent-plugin-prometheus (1.8.2)
    fluent-plugin-prometheus_pushgateway (0.0.2)
    fluent-plugin-record-modifier (2.1.0)
    fluent-plugin-rewrite-tag-filter (2.3.0)
    fluent-plugin-s3 (1.4.0)
    fluent-plugin-systemd (1.0.2)
    fluent-plugin-td (1.1.0)
    fluent-plugin-webhdfs (1.2.5)

As for td-agent v4, “fluent-plugin-mongo“ was installed under “/opt/td-agent/lib/ruby/gems/2.7.0/gems/” directories.

[root@fluent02 ~]# ll /opt/td-agent/lib/ruby/gems/2.7.0/gems/ | grep fluent-plugin*
drwxr-xr-x. 5 root root 4096 Dec 2 08:26 fluent-plugin-elasticsearch-4.1.1
drwxr-xr-x. 3 root root 169 Dec 2 08:26 fluent-plugin-kafka-0.14.1
drwxr-xr-x. 5 root root 209 Dec 2 08:36 fluent-plugin-mongo-1.5.0
drwxr-xr-x. 4 root root 200 Dec 2 08:26 fluent-plugin-prometheus-1.8.2
drwxr-xr-x. 6 root root 206 Dec 2 08:26 fluent-plugin-prometheus_pushgateway-0.0.2
drwxr-xr-x. 3 root root 161 Dec 2 08:26 fluent-plugin-record-modifier-2.1.0
drwxr-xr-x. 3 root root 210 Dec 2 08:26 fluent-plugin-rewrite-tag-filter-2.3.0
drwxr-xr-x. 3 root root 222 Dec 2 08:26 fluent-plugin-s3-1.4.0
drwxr-xr-x. 3 root root 49 Dec 2 08:26 fluent-plugin-systemd-1.0.2
drwxr-xr-x. 3 root root 236 Dec 2 08:26 fluent-plugin-td-1.1.0
drwxr-xr-x. 3 root root 176 Dec 2 08:26 fluent-plugin-webhdfs-1.2.5

8. Start td-agent v4 daemon.

[root@fluent02 ~]# systemctl start td-agent

9. Check if there are no error messages in tg-agent logs.

[root@fluent02 ~]# tail -100f /var/log/td-agent/td-agent.log

10. As for my sample configuration, I restart “sshd“ service for instance and see messages are stored in MongoDB as expected.

i) Restart “sshd“ daemon.

[root@fluent02 mongo]# systemctl restart sshd

ii) Confirm messages in “stdout“ output.

[root@fluent02 ~]# tail -100f /var/log/td-agent/td-agent.log

---------- Sample message ----------
2020-12-02 08:50:29.000000000 +0000 system.authpriv.info: {"host":"fluent02","ident":"sshd","pid":"2960","message":"Server listening on :: port 22."}

iii) Create sample script to read data from MongoDB.

[root@fluent02 mongo]# vim mongo_test.py
from pymongo import MongoClient
from bson.json_util import loads, dumps
import json

client = MongoClient('localhost', 27017)
db = client.rsyslog
collection = db.system
f = collection.find()
json_str = dumps(f)
print(json_str)

iv) Run sample script and confirm if same messages with “stdout“ are available.

[root@fluent02 mongo]# python3 mongo_test.py | jq

---------- Sample message ----------
    {
        "_id": {
            "$oid": "5fc7559b0bf9f80b84137e1f"
        },
            "host": "fluent02",
            "ident": "sshd",
            "pid": "2960",
            "message": "Server listening on :: port 22.",
            "time": {
                "$date": 1606899029000
            }
        }
    }

Now, upgrading steps are completed. Happy Logging!

This blog was originally written by kubotat in the Fluentd Subscription Network.

Fluentd v1.12.1 has been released

$
0
0

Hi users!

We have released v1.12.1. ChangeLog is here.

out_http: A new option headers_from_placeholders added

You can start using headers_from_placeholders to embed tags and record fields into HTTP headers.

headers_from_placeholders {"x-foo-bar":"${$.foo.bar}","x-tag":"app-${tag}"}
<buffer tag,$.foo.bar>
  # buffer parameters...
</buffer>

config-format: Markdown table support

fluent-plugin-config-format is now able to show the list of configuration options using a Markdown table.

$ fluent-plugin-config-format -t input dummy
...

### Configuration

|parameter|type|description|default|
|---|---|---|---|
|tag|string (required)|The value is the tag assigned to the generated events.||
|size|integer (optional)|The number of events in event stream of each emits.|`1`|
|rate|integer (optional)|It configures how many events to generate per second.|`1`|
|auto_increment_key|string (optional)|If specified, each generated event has an auto-incremented key field.||
|suspend|bool (optional)|The boolean to suspend-and-resume incremental value after restart<br>Deprecated: This parameters is ignored||
|sample| (optional)|The sample data to be generated. An array of JSON hashes or a single JSON hash.<br>Alias: dummy|`[{"message"=>"sample"}]`|

A new system option disable_shared_socket added

You can now prevent Fluentd from creating a communication socket by setting disable_shared_socket option (or --disable-shared-socket command-line parameter).

This option is useful, in particular, on Windows when you do not want Fluentd from occupying an ephemeral TCP port. Read the documentation for details.

Enjoy logging!

Fluentd v1.12.2 has been released

$
0
0

Hi users!

We have released v1.12.2. ChangeLog is here.

out_copy: Add a new attribute ignore_if_prev_successes

You can start using ignore_if_prev_successes to define fallback outputs. Fluentd will make use of these destinations if (and only if) the preceding outputs failed.

<store ignore_error>
  @type test
  name c0
</store>
<store ignore_if_prev_success ignore_error>
  @type test
  name c1
</store>
<store ignore_if_prev_success>
  @type test
  name c2
</store>

time-format: Add a new option time_format_fallbacks

Fluentd is now able to handle a heterogeneous time field. For example, if your timestamp field is mostly unixtime, but sometimes formatted in iso8601, you can specify as follows:

time_type mixed
time_format_fallbacks unixtime, %iso8601

formatter_ltsv: Safe delimiter character handling

To prevent LTSV data from being corrupted, we've started to substitute a delimiter character in records with a safe replacement. You can fine-tune the behaviour using replacement option as follows:

<format>
  @type ltsv
  replacement " "
</format>

Several in_tail stability fixes

We’ve fixed several in_tail stability issues:

  • in_tail may not send rotated logs when mv is used to rotate #3292
  • in_tail crashes worker upon ENOENT #3274

out_forward: Fix duplication logs at shutdown

Fluentd now waits ack responses in the shutdown phase correctly #3137.

Project Maintenance

  • Our community forum has been moved to Discuss. Google group is deprecated.
  • We've migrated CI from Travis CI and AppVeyor to GitHub Actions #3281#3290
  • We greet new maintainers from ClearCode Inc. #3282

Enjoy logging!

Fluentd v1.12.3 has been released

$
0
0

Hi users!

We have released v1.12.3. ChangeLog is here.

TLSServer: Enable TCP keep-alive support for TLS connections

TLS implementation was updated to allow the use of send_keepalive_packet. This feature can be used to detect dropped TLS connections, and to prevent them from consuming too much system resource.

<source>
  @type forward
  send_keepalive_packet true
  <transport tls>
    cert_path /path/to/fluentd.crt
    ...
  </transport>
</source>

TLSServer: Show peer information on connection errors

Starting from this version, Fluentd will includes the client information when it fails to establish a secure connection, to ease the diagnosis of TLS-related problems (such as invalid client certs).

2021-04-23 17:35:03 +0900 [warn]: #0 unexpected error before accepting TLS connection by OpenSSL host="127.0.0.1" port=34634 error_class=OpenSSL::SSL::SSLError error="SSL_accept returned=1 errno=0 state=error: tlsv1 alert unknown ca

in_tail: Fix IO error handling on Windows system

Previously, in_tail had a bug that reports a bogus IO error code on the Windows platform (e.g. reports ERROR_SHARING_VIOLATION on missing files).

Starting from this version, in_tail will retrieve Windows error codes correctly, and show much more descriptive messages for them.

Fluent::Win32Error: code: 32, The process cannot access the file because it is being used by another process. - C:\file.txt",

in_tail: Handle short-lived log files correctly

Fluentd v1.12.2 had a race-condition bug that throws an uncatched exception on short-lived files #3327. This version contains a fix for the issue.

Miscellaneous bug fixes

  • Fix parser_type symbol conflicts in parser_csv and parser_syslog. #3302
  • Fix position file corruption issue on concurrent gracefulReloads #3335
  • Fix incorrect warnings about ${chunk_id} with out_s3#3339

Enjoy logging!

Fluentd v1.12.4 has been released

$
0
0

Hi users!

We have released v1.12.4. This release is a maintenance release of v1.12 series. ChangeLog is here.

in_tail: Fix a bug that refresh_watcher fails to handle file rotations

In the previous Fluentd v1.11.x implementation uses path based tailing keys. Since v1.12, follow_inodes feature is introduced, but as a side effects unexpectedly, refresh_watcher tend to fail to handle file rotations correctly.

This version contains a fix for the issue only. #3393

Enjoy logging!


Fluentd v1.13.0 has been released

$
0
0

Hi users!

We have released v1.13.0. ChangeLog is here.

There are some topics in this release.

  • service_discovery: extended to support service discovery manager in simpler way
  • in_tail: handling log throttling per file feature has been supported
  • in_http: HTTP GET requests has been supported
  • The log rotate settings in system configuration has been supported
  • fluent-cat: the issue resending secondary file in specific format has been fixed

There are many in_tail bug fixes, we recommend to upgrade to v1.13.0.

service_discovery: extended to support service discovery manager in simpler way

In the previous versions, if plugin author supports service_discovery, it must build configurations structure explicitly, but it is complicated way.

Since Fluentd v1.13.0, it is enough to call #service_discovery_configure from Plugin#configure. It makes implementation costs lower.

in_tail: handling log throttling per file feature has been supported

In the previous versions, there is no way to limit log throttling.

Since Fluentd v1.13.0, the configuration parameter - read_bytes_limit_per_second is introduced.

<source>
  @type tail
  ...
  read_bytes_limit_per_second 4k
</source>

As read_bytes_limit_per_second accepts numbers with SI prefix such as 4k.

in_http: HTTP GET requests has been supported

This functionality is implemented to support health check feature on Azure App.

Azure App uses GET requests to check if the HTTP server is working all right. In the previous versions of Fluentd, it responds with "400 Bad Requests" to HTTP GET, so it does not work well for health checking purpose.

Since Fluentd v1.13.0, Fluentd returns a "200 OK".

Thanks Josh Keegan for requesting feature request!

The log rotate settings in system configuration has been supported

In the previous versions, log rotation options were supported as --log-rotate-age or --log-rotate-size via command line options.

On Windows, as Fluentd is launched as a windows service, it is required to configure again via --reg-winsvc-fluentdopt or edit fluentdopt registry key for log rotate customization.

These approach are not convenient for Windows users, so it may be better to support more comprehensive solution - customize via configuration file like this:

<system>
  <log>
    rotate_age 5
    rotate_size 1048576
  </log>
</system>

Now you can customize via rotate_age and rotate_size in log section.

fluent-cat: the issue resending secondary file in specific format has been fixed

The way to resend secondary is explained as How to resend secondary file, but it does not work if the record contains Fluent::EventTime. It raises Input must be a map (got Array) error.

In this release, it supports such a secondary file too.

Note that fluent-cat ignore timestamp which is stored in secondary records. (It is intended behavior for keeping consistency)

Miscellaneous bug fixes

  • Fixed to disable trace_instruction when RubyVM::InstructionSequence is available. It improves compatibility with truffleruby some extent. #3376
  • in_tail: Safely skip files which are used by another process on Windows. It improves exception handling about ERROR_SHARING_VIOLATION on Windows. #3378

Community topic

About three months has passed since community forum was moved to Discuss. Fluentd category is used actively nowadays! Note that fluentd forum on google groups is already deprecated.

Enjoy logging!

Fluentd v1.13.1 has been released

$
0
0

Hi users!

We have released v1.13.1. ChangeLog is here.

This release is a maintenance release of v1.13 series.

in_tail: Fixed to remove too much verbose debugging logs

It was unexpectedly introduced by #3185 - log throttling feature in v1.13.0. In this release, too much verbose debug logging was removed.

It has nothing to do with it when you didn't use in_tail with debug level.

Upgrade attention for TD Agent users

If you use Fluentd v1.12 or later, we recommend to use at least v1.12.4 or later. It is because in_tail contains serious bugs in it.

Note that even latest td-agent 4.1.1 also ships a buggy Fluentd v1.12.3. You should upgrade bundled Fluentd by yourself. This issue will be fixed in the future release of td-agent.

$ sudo td-agent-gem install fluentd --version=1.13.1

Enjoy logging!

Fluentd v1.13.2 has been released

$
0
0

Hi users!

We have released v1.13.2. ChangeLog is here.

This release is a maintenance release of v1.13 series. We recommend to upgrade Fluentd because it contains fixes about crash bugs.

Fixed a crash bug during startup phase

In this release, a crash bug was fixed during outputting log at the early stage when parsing invalid config file.

This was a bug since v1.13.0. If you use invalid '@' prefix parameter, remove it as a workaround.

in_tail: Fixed a bug that remaining lines will be discarded

When rotation is occurred with the throttling feature is enabled, there is a case that remaining lines will be discarded.

Added support to customize configuration of oj options

In this release, it is able to customize OJ options via environment variables.

Use the following environment variables to customize behavior of OJ.

  • FLUENT_OJ_OPTION_BIGDECIMAL_LOAD (float by default)
  • FLUENT_OJ_OPTION_MAX_NESTING
  • FLUENT_OJ_OPTION_MODE (compat by default)
  • FLUENT_OJ_OPTION_USE_TO_JSON (true by default)

See Oj Options about details of oj options.

Generating template of storage plugin was supported

Since v1.13.2, fluent-plugin-generate command has been supported to generate template files for storage plugin.

$ fluent-plugin-generate storage foo
License: Apache-2.0
        create Gemfile
        create README.md
        create Rakefile
        create fluent-plugin-foo.gemspec
        create lib/fluent/plugin/storage_foo.rb
        create test/helper.rb
        create test/plugin/test_storage_foo.rb
Initialized empty Git repository in /work/fluentd/fluentd/fluentd/fluent-plugin-foo/.git/

Upgrade attention for TD Agent users

If you use Fluentd v1.12 or later, we recommend to use at least v1.12.4. It is because in_tail contains serious bugs in it.

Note that even latest td-agent 4.1.1 also ships a buggy Fluentd v1.12.3. You should upgrade bundled Fluentd by yourself. This issue will be fixed in the future release of td-agent.

$ sudo td-agent-gem install fluentd --version=1.13.2

Enjoy logging!

Fluentd v1.13.3 has been released

$
0
0

Hi users!

We have released v1.13.3. ChangeLog is here.

This release is a maintenance release of v1.13 series. We recommend to upgrade Fluentd because it contains fixes about in_tail bugs.

in_tail: Fixed a bug that DeletePending state is not cared on Windows

In this release, Windows specific bug was fixed for in_tail plugin.

Windows has a concept of DeletePending, which means "DeleteFile() was called on that file. NTFS will remove this file once everyone close the handlers for it".

In the previous versions, it didn't care about it correctly, so there was a case that deleted file could not be handled properly.

in_tail: Fixed a bug that detecting rotation twice on follow_inode

In this release, the bug that duplicate events are emitted when follow_inode is true and rotation is occurred.

This bug was occurred when the following conditions are met:

  • Wrong inode is set to TailWatcher when follow_inode is true
  • A key (TargetInfo) in @tails isn't updated for a same path even if new one has different inode

We recommend to upgrade if you enable follow_inode.

in_tail: Fixed some position file related bugs

In this release, some bugs which are related to position file was fixed.

Here is the detail of fixed bugs:

  • When both follow_inodes and pos_file_compaction_interval are specified, file entries that didn't exist on start up will be deleted unexpectedly when compaction is triggered
  • String#bytesize should be used instead of String#size for path length, but it is not used

It causes a bug that file compaction does not work as expected.

Upgrade attention for TD Agent users

If you use Fluentd v1.12 or later, we recommend to use at least v1.12.4. It is because in_tail contains serious bugs in it.

Note that even latest td-agent 4.1.1 also ships a buggy Fluentd v1.12.3. You should upgrade bundled Fluentd by yourself. This issue will be fixed in the future release of td-agent.

$ sudo td-agent-gem install fluentd --version=1.13.3

Enjoy logging!

TD Agent v4.2.0 has been released

$
0
0

Hi users!

We have released v4.2.0. ChangeLog is here.

This release is a maintenance release of v4.x series. We recommend to upgrade TD Agent because it contains latest Fluentd v1.13.3.

Jemalloc was downgraded to v3.6.0

Because of excessive amounts of memory consuming issue, bundled version of jemalloc was downgraded from v5.2.1 to v3.6.0.

This issue seems a well known issue as follows:

Jemalloc v3.6.0 is stable enough (according to jemlloc's web site, it still seems be supported)

See https://github.com/fluent-plugins-nursery/td-agent-builder/issues/305 about details.

Dependency to perl package was removed

In the previous versions, td-agent has dependency to perl packages. This is because it bundles jeprof, but users do not want to install extra dependencies. So, we decided to drop it.

Enjoy logging!

Viewing all 163 articles
Browse latest View live