diff --git a/app/controllers/fluentd/settings/in_http_controller.rb b/app/controllers/fluentd/settings/in_http_controller.rb new file mode 100644 index 0000000..a80a564 --- /dev/null +++ b/app/controllers/fluentd/settings/in_http_controller.rb @@ -0,0 +1,9 @@ +class Fluentd::Settings::InHttpController < ApplicationController + include SettingConcern + + private + + def target_class + Fluentd::Setting::InHttp + end +end diff --git a/app/models/fluentd/setting/in_http.rb b/app/models/fluentd/setting/in_http.rb new file mode 100644 index 0000000..788a37d --- /dev/null +++ b/app/models/fluentd/setting/in_http.rb @@ -0,0 +1,45 @@ +class Fluentd + module Setting + class InHttp + include ActiveModel::Model + include Common + + KEYS = [ + :bind, :port, :body_size_limit, :keepalive_timeout, :add_http_headers, :format, :log_level + ].freeze + + attr_accessor(*KEYS) + + validates :bind, presence: true + validates :port, presence: true + + def self.initial_params + { + bind: "0.0.0.0", + port: 8888, + body_size_limit: "32m", + keepalive_timeout: "10s", + add_http_headers: false, + format: "default", + log_level: "info", + } + end + + def common_options + [ + :bind, :port + ] + end + + def advanced_options + [ + :body_size_limit, :keepalive_timeout, :add_http_headers, :format, :log_level + ] + end + + def plugin_name + "http" + end + end + end +end diff --git a/app/views/fluentd/settings/source_and_output.html.haml b/app/views/fluentd/settings/source_and_output.html.haml index 09fa2fb..abf67f0 100644 --- a/app/views/fluentd/settings/source_and_output.html.haml +++ b/app/views/fluentd/settings/source_and_output.html.haml @@ -18,6 +18,10 @@ = link_to(daemon_setting_in_monitor_agent_path(@fluentd)) do = icon('fa-file-text-o fa-lg') = t("fluentd.common.setup_in_monitor_agent") + %p + = link_to(daemon_setting_in_http_path(@fluentd)) do + = icon('fa-file-text-o fa-lg') + = t("fluentd.common.setup_in_http") .col-xs-1.arrow-right = icon "fa-arrow-circle-right" .col-xs-2 diff --git a/config/locales/translation_en.yml b/config/locales/translation_en.yml index 283ede8..b2e6c5b 100644 --- a/config/locales/translation_en.yml +++ b/config/locales/translation_en.yml @@ -98,6 +98,7 @@ en: setup_in_tail: File setup_in_syslog: Syslog Protocol setup_in_monitor_agent: Monitoring Agent + setup_in_http: http setup_out_td: Treasure Data setup_out_mongo: MongoDB setup_out_stdout: stdout (log) @@ -111,7 +112,7 @@ en: destroy_fluentd_setting: "Delete %{brand} setting" destroy_fluentd_setting_warning: | Delete %{brand} setting. - +
Running %{brand} will be stopped, but log and config file are still exists.
show: page_title: Dashboard @@ -179,6 +180,13 @@ en: Please see refer to the Monitoring Agent documentation page. show: page_title: Monitoring Agent (monitor_agent) + in_http: + option_guide: | + Retrieve records from http POST.起動中の%{brand}は停止し、ログや設定ファイルはそのまま残存します。
show: page_title: "ダッシュボード" @@ -181,6 +182,13 @@ ja: 監視エージェントのページもご参照ください。 show: page_title: 監視エージェント設定(monitor_agent) + in_http: + option_guide: | + http POSTからレコードを取得可能にします。