fluentd-ui 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fluentd-ui might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/ChangeLog.md +5 -0
- data/Gemfile.lock +1 -1
- data/app/controllers/api/settings_controller.rb +46 -16
- data/app/controllers/concerns/setting_concern.rb +1 -1
- data/app/controllers/fluentd/settings/filter_grep_controller.rb +9 -0
- data/app/controllers/fluentd/settings/filter_parser_controller.rb +9 -0
- data/app/controllers/fluentd/settings/filter_record_transformer_controller.rb +14 -0
- data/app/controllers/fluentd/settings/filter_stdout_controller.rb +9 -0
- data/app/javascript/packs/filter_grep_setting.js +39 -0
- data/app/javascript/packs/grep_container.js +53 -0
- data/app/javascript/packs/grep_pattern.js +43 -0
- data/app/javascript/packs/owned_plugin_form.js +9 -7
- data/app/javascript/packs/settings.js +34 -16
- data/app/models/concerns/fluentd/setting/configurable.rb +1 -0
- data/app/models/concerns/fluentd/setting/label.rb +11 -0
- data/app/models/concerns/fluentd/setting/plugin.rb +2 -0
- data/app/models/concerns/fluentd/setting/plugin_config.rb +34 -4
- data/app/models/concerns/fluentd/setting/section_config.rb +10 -2
- data/app/models/fluentd/agent/common.rb +97 -0
- data/app/models/fluentd/setting/config.rb +71 -0
- data/app/models/fluentd/setting/filter_grep.rb +38 -0
- data/app/models/fluentd/setting/filter_parser.rb +34 -0
- data/app/models/fluentd/setting/filter_record_transformer.rb +27 -0
- data/app/models/fluentd/setting/filter_stdout.rb +34 -0
- data/app/models/fluentd/setting/in_forward.rb +1 -0
- data/app/models/fluentd/setting/in_http.rb +1 -1
- data/app/models/fluentd/setting/in_monitor_agent.rb +1 -1
- data/app/models/fluentd/setting/in_syslog.rb +1 -1
- data/app/models/fluentd/setting/out_elasticsearch.rb +1 -0
- data/app/models/fluentd/setting/out_forward.rb +1 -1
- data/app/models/fluentd/setting/out_mongo.rb +1 -0
- data/app/models/fluentd/setting/out_s3.rb +1 -0
- data/app/models/fluentd/setting/out_stdout.rb +1 -1
- data/app/models/fluentd/setting/out_tdlog.rb +1 -1
- data/app/views/api/settings/_element.json.jbuilder +3 -1
- data/app/views/api/settings/index.json.jbuilder +10 -2
- data/app/views/api/settings/show.json.jbuilder +1 -1
- data/app/views/fluentd/settings/filter_grep/_form.html.haml +18 -0
- data/app/views/fluentd/settings/filter_record_transformer/_form.html.haml +20 -0
- data/app/views/fluentd/settings/in_tail/_form.html.haml +1 -0
- data/app/views/fluentd/settings/source_and_output.html.haml +46 -14
- data/app/views/shared/vue/_filter_grep_setting.html.haml +19 -0
- data/app/views/shared/vue/_grep_container.html.haml +32 -0
- data/app/views/shared/vue/_grep_pattern.html.haml +24 -0
- data/app/views/shared/vue/_setting.html.erb +2 -2
- data/config/locales/translation_en.yml +39 -10
- data/config/locales/translation_ja.yml +39 -10
- data/config/routes.rb +6 -0
- data/lib/fluentd-ui/version.rb +1 -1
- data/test/factories/fluentd.rb +4 -4
- data/test/factories/plugins.rb +2 -2
- data/test/factories/user.rb +2 -2
- data/test/fixtures/config/label.conf +15 -0
- data/test/fixtures/config/multi-label.conf +40 -0
- data/test/fixtures/config/simple.conf +12 -0
- data/test/models/fluentd/agent_common_test.rb +288 -0
- data/test/models/fluentd/setting/config_test.rb +98 -0
- data/test/support/configurable_daemon_settings.rb +1 -1
- data/test/system/fluentd/setting/filter_grep_test.rb +96 -0
- data/test/system/fluentd/setting/filter_parser_test.rb +13 -0
- data/test/system/fluentd/setting/filter_record_transformer_test.rb +30 -0
- data/test/system/fluentd/setting/filter_stdout_test.rb +13 -0
- data/test/system/source_and_output_test.rb +168 -19
- data/test/test_helper.rb +4 -0
- metadata +98 -55
- data/.rspec +0 -2
@@ -112,6 +112,10 @@ ja:
|
|
112
112
|
setup_in_monitor_agent: 監視エージェント
|
113
113
|
setup_in_http: http
|
114
114
|
setup_in_forward: 転送(他Fluentdからの受信)
|
115
|
+
setup_filter_grep: フィルタリング(grep)
|
116
|
+
setup_filter_parser: パース
|
117
|
+
setup_filter_record_transformer: レコード加工
|
118
|
+
setup_filter_stdout: 標準出力(ログ)
|
115
119
|
setup_out_tdlog: Treasure Data
|
116
120
|
setup_out_stdout: 標準出力(ログ)
|
117
121
|
setup_out_mongo: MongoDB
|
@@ -144,6 +148,7 @@ ja:
|
|
144
148
|
page_title: ソースと出力先の追加
|
145
149
|
in: 入力
|
146
150
|
out: 出力
|
151
|
+
filter: フィルター
|
147
152
|
current: 現在の設定
|
148
153
|
setting_empty: 設定されていません
|
149
154
|
show:
|
@@ -153,7 +158,7 @@ ja:
|
|
153
158
|
page_title: 設定ファイルの編集
|
154
159
|
out_forward:
|
155
160
|
option_guide: |
|
156
|
-
<a target="_blank" href="
|
161
|
+
<a target="_blank" href="https://docs.fluentd.org/articles/out_forward">out_forwardプラグインの解説</a>もご参照ください。
|
157
162
|
secondary_note: |
|
158
163
|
※どのserverにも転送できなかった場合、上記のパスにファイルとしてデータが保存されます。
|
159
164
|
show:
|
@@ -161,7 +166,7 @@ ja:
|
|
161
166
|
out_s3:
|
162
167
|
option_guide: |
|
163
168
|
fluent-plugin-s3プラグインのインストールが必要です。<br />
|
164
|
-
<a target="_blank" href="
|
169
|
+
<a target="_blank" href="https://docs.fluentd.org/articles/out_s3">out_s3プラグインの解説</a>もご参照ください。
|
165
170
|
show:
|
166
171
|
page_title: AWS S3書き出し設定
|
167
172
|
out_tdlog:
|
@@ -172,37 +177,61 @@ ja:
|
|
172
177
|
out_elasticsearch:
|
173
178
|
option_guide: |
|
174
179
|
fluent-plugin-elasticsearchプラグインのインストールが必要です。<br />
|
175
|
-
<a target="_blank" href="
|
180
|
+
<a target="_blank" href="httpss://github.com/uken/fluent-plugin-elasticsearch">out_elasticsearchプラグインの解説</a>もご参照ください。
|
176
181
|
show:
|
177
182
|
page_title: Elasticsearch設定
|
178
183
|
out_mongo:
|
179
184
|
option_guide: |
|
180
185
|
fluent-plugin-mongoプラグインのインストールが必要です。<br />
|
181
|
-
<a target="_blank" href="
|
186
|
+
<a target="_blank" href="https://docs.fluentd.org/articles/out_mongo">out_mongoプラグインの解説</a>もご参照ください。
|
182
187
|
show:
|
183
188
|
page_title: MongoDB書き出し設定
|
184
189
|
out_stdout:
|
185
190
|
option_guide: |
|
186
191
|
標準出力(デーモンとして起動しているときはログファイル)へイベントを書き出します。<br />
|
187
|
-
<a target="_blank" href="
|
192
|
+
<a target="_blank" href="https://docs.fluentd.org/articles/out_stdout">out_stdoutプラグインの解説</a>もご参照ください。
|
193
|
+
show:
|
194
|
+
page_title: 標準出力(ログ)
|
195
|
+
filter_grep:
|
196
|
+
option_guide: |
|
197
|
+
指定したフィールドの値を元にイベントを「Grep」します。<br />
|
198
|
+
<a target="_blank" href="https://docs.fluentd.org/articles/filter_grep">filter_grepプラグインの解説</a>もご参照ください。
|
199
|
+
show:
|
200
|
+
page_title: Grepフィルター設定
|
201
|
+
filter_parser:
|
202
|
+
option_guide: |
|
203
|
+
指定したフィールドの値をパースした結果を使ってイベントを加工します。<br />
|
204
|
+
<a target="_blank" href="https://docs.fluentd.org/articles/filter_parser">filter_parserプラグインの解説</a>もご参照ください。
|
205
|
+
show:
|
206
|
+
page_title: Parserフィルター設定
|
207
|
+
filter_record_transformer:
|
208
|
+
option_guide: |
|
209
|
+
様々な方法でイベントを加工します。<br />
|
210
|
+
<a target="_blank" href="https://docs.fluentd.org/articles/filter_record_transformer">filter_record_transformerプラグインの解説</a>もご参照ください。
|
211
|
+
show:
|
212
|
+
page_title: レコード加工設定
|
213
|
+
filter_stdout:
|
214
|
+
option_guide: |
|
215
|
+
標準出力(デーモンとして起動しているときはログファイル)へイベントを書き出します。<br />
|
216
|
+
<a target="_blank" href="https://docs.fluentd.org/articles/filter_stdout">filter_stdoutプラグインの解説</a>もご参照ください。
|
188
217
|
show:
|
189
218
|
page_title: 標準出力(ログ)
|
190
219
|
in_syslog:
|
191
220
|
option_guide: |
|
192
|
-
<a target="_blank" href="
|
221
|
+
<a target="_blank" href="https://docs.fluentd.org/articles/in_syslog">in_syslogプラグイン解説ページ</a>もご参照ください。
|
193
222
|
show:
|
194
223
|
page_title: Syslog読み込み設定
|
195
224
|
in_monitor_agent:
|
196
225
|
option_guide: |
|
197
226
|
HTTP経由で現在稼働中のfluentdが使用しているconfigやプラグインをJSONやLTSV形式で取得できます。<br />
|
198
|
-
<a target="_blank" href="
|
227
|
+
<a target="_blank" href="https://docs.fluentd.org/articles/monitoring">監視エージェント</a>のページもご参照ください。
|
199
228
|
show:
|
200
229
|
page_title: 監視エージェント設定(monitor_agent)
|
201
230
|
in_http:
|
202
231
|
option_guide: |
|
203
232
|
http POSTからレコードを取得可能にします。<br />
|
204
233
|
URLパスはFluentdイベントログのタグとなり、ポストされたbody要素はレコードそのものになります。<br />
|
205
|
-
<a target="_blank" href="
|
234
|
+
<a target="_blank" href="https://docs.fluentd.org/articles/in_http">httpインプットプラグイン解説ページ</a>もご参照ください。
|
206
235
|
show:
|
207
236
|
page_title: http入力設定
|
208
237
|
in_forward:
|
@@ -210,12 +239,12 @@ ja:
|
|
210
239
|
TCPソケットをリッスンし、イベントストリームを受信します。<br />
|
211
240
|
UDPソケットもリッスンし、ハートビートメッセージを受信します。<br />
|
212
241
|
他のFluentdインスタンス、fluent-catコマンドまたはクライアントライブラリーからイベントログを受信するために使用されます。<br />
|
213
|
-
<a target="_blank" href="
|
242
|
+
<a target="_blank" href="https://docs.fluentd.org/articles/in_forward">forwardインプットプラグイン解説ページ</a>もご参照ください。
|
214
243
|
show:
|
215
244
|
page_title: forward入力設定
|
216
245
|
|
217
246
|
in_tail_option_guide: |
|
218
|
-
<a target="_blank" href="
|
247
|
+
<a target="_blank" href="https://docs.fluentd.org/articles/in_tail">in_tailプラグインの解説ページ</a>や
|
219
248
|
<a target="_blank" href="http://fluentular.herokuapp.com/">Fluentular</a>もご参照ください。
|
220
249
|
in_tail:
|
221
250
|
notice_for_multiline_limit: "改行区切りで正規表現を入力してください。空行はカウントされません。21行目以降の入力は無視されます。"
|
data/config/routes.rb
CHANGED
@@ -41,6 +41,12 @@ Rails.application.routes.draw do
|
|
41
41
|
post "finish"
|
42
42
|
end
|
43
43
|
|
44
|
+
%w(grep parser record_transformer stdout).each do |type|
|
45
|
+
resource "filter_#{type}", only: [:show], module: :settings, controller: "filter_#{type}" do
|
46
|
+
post "finish"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
44
50
|
resource :out_stdout, only: [:show], module: :settings, controller: :out_stdout do
|
45
51
|
post "finish"
|
46
52
|
end
|
data/lib/fluentd-ui/version.rb
CHANGED
data/test/factories/fluentd.rb
CHANGED
@@ -3,9 +3,9 @@ FactoryBot.define do
|
|
3
3
|
dir = Rails.root.join("tmp/fluentd-test").to_s
|
4
4
|
FileUtils.mkdir_p(dir)
|
5
5
|
|
6
|
-
variant "fluentd_gem"
|
7
|
-
log_file dir + "/fluentd.log"
|
8
|
-
pid_file dir + "/fluentd.pid"
|
9
|
-
config_file dir + "/fluentd.conf"
|
6
|
+
variant { "fluentd_gem" }
|
7
|
+
log_file { dir + "/fluentd.log" }
|
8
|
+
pid_file { dir + "/fluentd.pid" }
|
9
|
+
config_file { dir + "/fluentd.conf" }
|
10
10
|
end
|
11
11
|
end
|
data/test/factories/plugins.rb
CHANGED
data/test/factories/user.rb
CHANGED
@@ -0,0 +1,40 @@
|
|
1
|
+
<source>
|
2
|
+
@type dummy
|
3
|
+
tag dummy1
|
4
|
+
@label @INPUT
|
5
|
+
</source>
|
6
|
+
|
7
|
+
<source>
|
8
|
+
@type dummy
|
9
|
+
tag dummy2
|
10
|
+
@label @INPUT
|
11
|
+
</source>
|
12
|
+
|
13
|
+
<label @INPUT>
|
14
|
+
<filter dummy1>
|
15
|
+
@type stdout
|
16
|
+
</filter>
|
17
|
+
|
18
|
+
<match dummy1>
|
19
|
+
@type relabel
|
20
|
+
@label @MAIN
|
21
|
+
</match>
|
22
|
+
</label>
|
23
|
+
|
24
|
+
<label @MAIN>
|
25
|
+
<filter dummy1>
|
26
|
+
@type stdout
|
27
|
+
</filter>
|
28
|
+
|
29
|
+
<filter dummy2>
|
30
|
+
@type stdout
|
31
|
+
</filter>
|
32
|
+
|
33
|
+
<match dummy1>
|
34
|
+
@type stdout
|
35
|
+
</match>
|
36
|
+
|
37
|
+
<match dummy2>
|
38
|
+
@type stdout
|
39
|
+
</match>
|
40
|
+
</label>
|
@@ -0,0 +1,288 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
class Fluentd
|
4
|
+
class TestAgentCommon < ActiveSupport::TestCase
|
5
|
+
class DummyAgent
|
6
|
+
include ::Fluentd::Agent::Common
|
7
|
+
end
|
8
|
+
|
9
|
+
setup do
|
10
|
+
@agent = DummyAgent.new
|
11
|
+
end
|
12
|
+
|
13
|
+
sub_test_case "#parse_config" do
|
14
|
+
test "empty" do
|
15
|
+
actual = @agent.__send__(:parse_config, "")
|
16
|
+
assert_equal({}, actual)
|
17
|
+
end
|
18
|
+
|
19
|
+
test "simple" do
|
20
|
+
actual = @agent.__send__(:parse_config, fixture_content("config/simple.conf"))
|
21
|
+
source_section_content = <<-CONFIG.strip_heredoc.chomp
|
22
|
+
<source>
|
23
|
+
@type dummy
|
24
|
+
tag dummy
|
25
|
+
</source>
|
26
|
+
CONFIG
|
27
|
+
filter_section_content = <<-CONFIG.strip_heredoc.chomp
|
28
|
+
<filter dummy>
|
29
|
+
@type stdout
|
30
|
+
</filter>
|
31
|
+
CONFIG
|
32
|
+
match_section_content = <<-CONFIG.strip_heredoc.chomp
|
33
|
+
<match dummy>
|
34
|
+
@type stdout
|
35
|
+
</match>
|
36
|
+
CONFIG
|
37
|
+
expected = {
|
38
|
+
"source" => [
|
39
|
+
{ pos: 0, content: source_section_content }
|
40
|
+
],
|
41
|
+
"filter" => [
|
42
|
+
{ pos: 44, content: filter_section_content }
|
43
|
+
],
|
44
|
+
"match" => [
|
45
|
+
{ pos: 85, content: match_section_content }
|
46
|
+
]
|
47
|
+
}
|
48
|
+
assert_equal(expected, actual)
|
49
|
+
end
|
50
|
+
|
51
|
+
test "simple label" do
|
52
|
+
actual = @agent.__send__(:parse_config, fixture_content("config/label.conf"))
|
53
|
+
source_section_content = <<-CONFIG.strip_heredoc.chomp
|
54
|
+
<source>
|
55
|
+
@type dummy
|
56
|
+
tag dummy
|
57
|
+
@label @INPUT
|
58
|
+
</source>
|
59
|
+
CONFIG
|
60
|
+
filter_section_content = <<-CONFIG.chomp
|
61
|
+
<filter dummy>
|
62
|
+
@type stdout
|
63
|
+
</filter>
|
64
|
+
CONFIG
|
65
|
+
match_section_content = <<-CONFIG.chomp
|
66
|
+
<match dummy>
|
67
|
+
@type stdout
|
68
|
+
</match>
|
69
|
+
CONFIG
|
70
|
+
sections = {
|
71
|
+
"filter" => [
|
72
|
+
{ label: "@INPUT", pos: 76, content: filter_section_content}
|
73
|
+
],
|
74
|
+
"match" => [
|
75
|
+
{ label: "@INPUT", pos: 122, content: match_section_content}
|
76
|
+
]
|
77
|
+
}
|
78
|
+
expected = {
|
79
|
+
"source" => [
|
80
|
+
{ pos: 0, content: source_section_content }
|
81
|
+
],
|
82
|
+
"label:@INPUT" => [
|
83
|
+
{ label: "@INPUT", pos: 60, sections: sections, size: 116 }
|
84
|
+
]
|
85
|
+
}
|
86
|
+
assert_equal(expected, actual)
|
87
|
+
end
|
88
|
+
|
89
|
+
test "multiple labels" do
|
90
|
+
actual = @agent.__send__(:parse_config, fixture_content("config/multi-label.conf"))
|
91
|
+
source_section_content1 = <<-CONFIG.strip_heredoc.chomp
|
92
|
+
<source>
|
93
|
+
@type dummy
|
94
|
+
tag dummy1
|
95
|
+
@label @INPUT
|
96
|
+
</source>
|
97
|
+
CONFIG
|
98
|
+
source_section_content2 = <<-CONFIG.strip_heredoc.chomp
|
99
|
+
<source>
|
100
|
+
@type dummy
|
101
|
+
tag dummy2
|
102
|
+
@label @INPUT
|
103
|
+
</source>
|
104
|
+
CONFIG
|
105
|
+
filter_section_content = <<-CONFIG.chomp
|
106
|
+
<filter dummy1>
|
107
|
+
@type stdout
|
108
|
+
</filter>
|
109
|
+
CONFIG
|
110
|
+
match_section_content = <<-CONFIG.chomp
|
111
|
+
<match dummy1>
|
112
|
+
@type relabel
|
113
|
+
@label @MAIN
|
114
|
+
</match>
|
115
|
+
CONFIG
|
116
|
+
input_sections = {
|
117
|
+
"filter" => [
|
118
|
+
{ label: "@INPUT", pos: 140, content: filter_section_content }
|
119
|
+
],
|
120
|
+
"match" => [
|
121
|
+
{ label: "@INPUT", pos: 187, content: match_section_content }
|
122
|
+
]
|
123
|
+
}
|
124
|
+
filter_secion_content1 = <<-CONFIG.chomp
|
125
|
+
<filter dummy1>
|
126
|
+
@type stdout
|
127
|
+
</filter>
|
128
|
+
CONFIG
|
129
|
+
filter_secion_content2 = <<-CONFIG.chomp
|
130
|
+
<filter dummy2>
|
131
|
+
@type stdout
|
132
|
+
</filter>
|
133
|
+
CONFIG
|
134
|
+
match_secion_content1 = <<-CONFIG.chomp
|
135
|
+
<match dummy1>
|
136
|
+
@type stdout
|
137
|
+
</match>
|
138
|
+
CONFIG
|
139
|
+
match_secion_content2 = <<-CONFIG.chomp
|
140
|
+
<match dummy2>
|
141
|
+
@type stdout
|
142
|
+
</match>
|
143
|
+
CONFIG
|
144
|
+
main_sections = {
|
145
|
+
"filter" => [
|
146
|
+
{ label: "@MAIN", pos: 275, content: filter_secion_content1 },
|
147
|
+
{ label: "@MAIN", pos: 322, content: filter_secion_content2 }
|
148
|
+
],
|
149
|
+
"match" => [
|
150
|
+
{ label: "@MAIN", pos: 370, content: match_secion_content1 },
|
151
|
+
{ label: "@MAIN", pos: 416, content: match_secion_content2 }
|
152
|
+
]
|
153
|
+
}
|
154
|
+
expected = {
|
155
|
+
"source" => [
|
156
|
+
{ pos: 0, content: source_section_content1 },
|
157
|
+
{ pos: 61, content: source_section_content2 },
|
158
|
+
],
|
159
|
+
"label:@INPUT" => [
|
160
|
+
{ label: "@INPUT", pos: 124, sections: input_sections, size: 136 }
|
161
|
+
],
|
162
|
+
"label:@MAIN" => [
|
163
|
+
{ label: "@MAIN", pos: 260, sections: main_sections, size: 211 }
|
164
|
+
]
|
165
|
+
}
|
166
|
+
assert_equal(expected, actual)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
sub_test_case "#dump_parsed_config" do
|
171
|
+
test "simple" do
|
172
|
+
parsed_config = @agent.__send__(:parse_config, fixture_content("config/simple.conf"))
|
173
|
+
config = @agent.__send__(:dump_parsed_config, parsed_config)
|
174
|
+
assert_equal(fixture_content("config/simple.conf"), config)
|
175
|
+
end
|
176
|
+
|
177
|
+
test "simple label" do
|
178
|
+
parsed_config = @agent.__send__(:parse_config, fixture_content("config/label.conf"))
|
179
|
+
config = @agent.__send__(:dump_parsed_config, parsed_config)
|
180
|
+
assert_equal(fixture_content("config/label.conf"), config)
|
181
|
+
end
|
182
|
+
|
183
|
+
test "multiple labels" do
|
184
|
+
parsed_config = @agent.__send__(:parse_config, fixture_content("config/multi-label.conf"))
|
185
|
+
config = @agent.__send__(:dump_parsed_config, parsed_config)
|
186
|
+
assert_equal(fixture_content("config/multi-label.conf"), config)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
sub_test_case "#config_merge" do
|
191
|
+
test "simple" do
|
192
|
+
stub(@agent).config { fixture_content("config/simple.conf") }
|
193
|
+
stub(@agent).backup_config
|
194
|
+
content = <<-CONFIG
|
195
|
+
<match dummy3>
|
196
|
+
@type stdout
|
197
|
+
</match>
|
198
|
+
CONFIG
|
199
|
+
mock(@agent).config_append(content)
|
200
|
+
@agent.config_merge(content)
|
201
|
+
end
|
202
|
+
|
203
|
+
test "simple with label" do
|
204
|
+
stub(@agent).config { fixture_content("config/simple.conf") }
|
205
|
+
stub(@agent).backup_config
|
206
|
+
content = <<-CONFIG
|
207
|
+
<label @INPUT>
|
208
|
+
<match dummy3>
|
209
|
+
@type stdout
|
210
|
+
</match>
|
211
|
+
</label>
|
212
|
+
CONFIG
|
213
|
+
mock(@agent).config_append(content)
|
214
|
+
@agent.config_merge(content)
|
215
|
+
end
|
216
|
+
|
217
|
+
test "append to label" do
|
218
|
+
stub(@agent).config { fixture_content("config/label.conf") }
|
219
|
+
stub(@agent).config_file { "tmp/fluent.conf" }
|
220
|
+
stub(@agent).backup_config
|
221
|
+
content = <<-CONFIG
|
222
|
+
<label @INPUT>
|
223
|
+
<match dummy3>
|
224
|
+
@type stdout
|
225
|
+
</match>
|
226
|
+
</label>
|
227
|
+
CONFIG
|
228
|
+
mock(@agent).config_write(<<-CONFIG)
|
229
|
+
<source>
|
230
|
+
@type dummy
|
231
|
+
tag dummy
|
232
|
+
@label @INPUT
|
233
|
+
</source>
|
234
|
+
|
235
|
+
<label @INPUT>
|
236
|
+
<filter dummy>
|
237
|
+
@type stdout
|
238
|
+
</filter>
|
239
|
+
|
240
|
+
<match dummy>
|
241
|
+
@type stdout
|
242
|
+
</match>
|
243
|
+
|
244
|
+
<match dummy3>
|
245
|
+
@type stdout
|
246
|
+
</match>
|
247
|
+
</label>
|
248
|
+
CONFIG
|
249
|
+
@agent.config_merge(content)
|
250
|
+
end
|
251
|
+
|
252
|
+
test "append filter to label" do
|
253
|
+
stub(@agent).config { fixture_content("config/label.conf") }
|
254
|
+
stub(@agent).config_file { "tmp/fluent.conf" }
|
255
|
+
stub(@agent).backup_config
|
256
|
+
content = <<-CONFIG
|
257
|
+
<label @INPUT>
|
258
|
+
<filter dummy3>
|
259
|
+
@type stdout
|
260
|
+
</filter>
|
261
|
+
</label>
|
262
|
+
CONFIG
|
263
|
+
mock(@agent).config_write(<<-CONFIG)
|
264
|
+
<source>
|
265
|
+
@type dummy
|
266
|
+
tag dummy
|
267
|
+
@label @INPUT
|
268
|
+
</source>
|
269
|
+
|
270
|
+
<label @INPUT>
|
271
|
+
<filter dummy>
|
272
|
+
@type stdout
|
273
|
+
</filter>
|
274
|
+
|
275
|
+
<filter dummy3>
|
276
|
+
@type stdout
|
277
|
+
</filter>
|
278
|
+
|
279
|
+
<match dummy>
|
280
|
+
@type stdout
|
281
|
+
</match>
|
282
|
+
</label>
|
283
|
+
CONFIG
|
284
|
+
@agent.config_merge(content)
|
285
|
+
end
|
286
|
+
end
|
287
|
+
end
|
288
|
+
end
|