Add http input settings.

This commit is contained in:
hassaku 2014-12-03 12:02:40 +09:00
parent 9ac66f05d3
commit 155e33d6dd
6 changed files with 80 additions and 2 deletions

View File

@ -0,0 +1,9 @@
class Fluentd::Settings::InHttpController < ApplicationController
include SettingConcern
private
def target_class
Fluentd::Setting::InHttp
end
end

View File

@ -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

View File

@ -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

View File

@ -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.
<p>Running %{brand} will be stopped, but log and config file are still exists.</p>
show:
page_title: Dashboard
@ -179,6 +180,13 @@ en:
Please see refer to the <a target="_blank" href="http://docs.fluentd.org/articles/monitoring">Monitoring Agent</a> documentation page.
show:
page_title: Monitoring Agent (monitor_agent)
in_http:
option_guide: |
Retrieve records from http POST.<br />
The URL path becomes the tag of the Fluentd event log and the POSTed body element becomes the record itself.<br />
Please see refer to the <a target="_blank" href="http://docs.fluentd.org/articles/in_http">http Input Plugin</a> documentation page.
show:
page_title: Add http Input Plugin
in_tail_option_guide: |
For each config parameter, please refer to the <a href="http://docs.fluentd.org/articles/in_tail" target="_blank">Tail input plugin</a> documentation page.
in_tail:

View File

@ -97,6 +97,7 @@ ja:
setup_in_tail: ファイル
setup_in_syslog: syslogプロトコル
setup_in_monitor_agent: 監視エージェント
setup_in_http: http
setup_out_td: Treasure Data
setup_out_stdout: 標準出力(ログ)
setup_out_mongo: MongoDB
@ -110,7 +111,7 @@ ja:
destroy_fluentd_setting: "%{brand}の設定情報を削除"
destroy_fluentd_setting_warning: |
%{brand}の設定を削除します。
<p>起動中の%{brand}は停止し、ログや設定ファイルはそのまま残存します。</p>
show:
page_title: "ダッシュボード"
@ -181,6 +182,13 @@ ja:
<a target="_blank" href="http://docs.fluentd.org/ja/articles/monitoring">監視エージェント</a>のページもご参照ください。
show:
page_title: 監視エージェント設定(monitor_agent)
in_http:
option_guide: |
http POSTからレコードを取得可能にします。<br />
URLパスはFluentdイベントログのタグとなり、ポストされたbody要素はレコードそのものになります。<br />
<a target="_blank" href="http://docs.fluentd.org/ja/articles/in_http">httpインプットプラグイン解説ページ</a>もご参照ください。
show:
page_title: http入力設定
in_tail_option_guide: |
<a target="_blank" href="http://docs.fluentd.org/ja/articles/in_tail">in_tailプラグインの解説ページ</a>や
<a target="_blank" href="http://fluentular.herokuapp.com/">Fluentular</a>もご参照ください。

View File

@ -32,6 +32,10 @@ Rails.application.routes.draw do
post "finish"
end
resource :in_http, only: [:show], module: :settings, controller: :in_http do
post "finish"
end
resource :out_stdout, only: [:show], module: :settings, controller: :out_stdout do
post "finish"
end