Hi users!
We have released v1.11.1. ChangeLog is here.
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.
Enjoy logging!
Subscribed to the RSS feed here.
Masahiro (@repeatedly) is the main maintainer of Fluentd. He works on Fluentd development and support full-time. He is also a committer of the D programming language.
Fluentd is an open source data collector to unify log management.
2024-08-29: Scheduled support lifecycle announcement about Fluent Package v6
2023-08-29: Drop schedule announcement about EOL of Treasure Agent (td-agent) 4
2023-08-29: Scheduled support lifecycle announcement about Fluent Package
2023-07-31: Upgrade to fluent-package v5
2025-02-14: fluent-package v5.0.6 has been released
2025-01-29: Fluentd v1.16.7 has been released
2024-12-14: fluent-package v5.2.0 has been released
2024-11-29: Fluentd v1.18.0 has been released
2024-11-08: fluent-package v5.0.5 has been released
2024-08-29: Scheduled support lifecycle announcement about Fluent Package v6
2024-08-20: Fluentd v1.16.6 has been released
2024-08-19: Fluentd v1.17.1 has been released
2024-08-02: fluent-package v5.1.0 has been released
2024-07-02: fluent-package v5.0.4 has been released
Want to learn the basics of Fluentd? Check out these pages.
Couldn't find enough information? Let's ask the community!
You need commercial-grade support from Fluentd committers and experts?
©2010-2025 Fluentd Project. ALL Rights Reserved.
Fluentd is a hosted project under the Cloud Native Computing Foundation (CNCF). All components are available under the Apache 2 License.