fluent-plugin-parser_cefalt 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.codeclimate.yml +29 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +58 -0
- data/.rspec +3 -0
- data/.rubocop.yml +1156 -0
- data/.travis.yml +6 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +90 -0
- data/Rakefile +2 -0
- data/VERSION +1 -0
- data/fluent-plugin-parser_cefalt.gemspec +29 -0
- data/lib/fluent/plugin/config/cef_version_0_keys.yaml +221 -0
- data/lib/fluent/plugin/parser_cefalt.rb +222 -0
- data/spec/fluent/plugin/parser_cefalt_spec.rb +377 -0
- data/spec/sample/fluentd.conf +31 -0
- data/spec/spec_helper.rb +116 -0
- metadata +154 -0
@@ -0,0 +1,377 @@
|
|
1
|
+
#-*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
require 'fluent/plugin/parser_cef'
|
4
|
+
require 'fluent/test'
|
5
|
+
require 'fluent/test/driver/parser'
|
6
|
+
|
7
|
+
RSpec.describe Fluent::Plugin::CommonEventFormatParser do
|
8
|
+
|
9
|
+
DEFAULT_CONFIGURE = %[
|
10
|
+
log_format syslog
|
11
|
+
syslog_timestamp_format \\w{3}\\s+\\d{1,2}\\s\\d{2}:\\d{2}:\\d{2}
|
12
|
+
cef_version 0
|
13
|
+
parse_strict_mode true
|
14
|
+
cef_keyfilename 'config/cef_version_0_keys.yaml'
|
15
|
+
output_raw_field false
|
16
|
+
]
|
17
|
+
def create_driver(conf=DEFAULT_CONFIGURE)
|
18
|
+
Fluent::Test::Driver::Parser.new(Fluent::Plugin::CommonEventFormatParser).configure(conf)
|
19
|
+
end
|
20
|
+
|
21
|
+
before :all do
|
22
|
+
Fluent::Test.setup
|
23
|
+
end
|
24
|
+
|
25
|
+
before :each do
|
26
|
+
@test_driver = create_driver
|
27
|
+
end
|
28
|
+
|
29
|
+
describe "#parse(text)" do
|
30
|
+
|
31
|
+
context "text == nil" do
|
32
|
+
let (:text) { nil }
|
33
|
+
subject do
|
34
|
+
parsed = nil
|
35
|
+
@test_driver.instance.parse(text) do |time, record|
|
36
|
+
parsed = [time, record]
|
37
|
+
end
|
38
|
+
parsed
|
39
|
+
end
|
40
|
+
it { is_expected.to eq [nil, nil] }
|
41
|
+
end
|
42
|
+
context "text is empty string" do
|
43
|
+
let (:text) { "" }
|
44
|
+
subject do
|
45
|
+
parsed = nil
|
46
|
+
@test_driver.instance.parse(text) do |time, record|
|
47
|
+
parsed = [time, record]
|
48
|
+
end
|
49
|
+
parsed
|
50
|
+
end
|
51
|
+
it { is_expected.to eq [nil, nil] }
|
52
|
+
end
|
53
|
+
context "text is not syslog format nor CEF" do
|
54
|
+
let (:text) { "December 12 10:00:00 hostname tag message" }
|
55
|
+
subject do
|
56
|
+
allow(Fluent::Engine).to receive(:now).and_return(Fluent::EventTime.now)
|
57
|
+
parsed = nil
|
58
|
+
@test_driver.instance.parse(text) do |time, record|
|
59
|
+
parsed = [time, record]
|
60
|
+
end
|
61
|
+
parsed
|
62
|
+
end
|
63
|
+
it { is_expected.to contain_exactly(be_an(Fluent::EventTime), { "raw" => "December 12 10:00:00 hostname tag message" }) }
|
64
|
+
end
|
65
|
+
context "text is not in syslog format but is CEF" do
|
66
|
+
let (:text) { "December 12 10:00:00 hostname tag CEF:0|Vendor|Product|Version|ID|Name|Severity|cs1=test" }
|
67
|
+
subject do
|
68
|
+
allow(Fluent::Engine).to receive(:now).and_return(Fluent::EventTime.now)
|
69
|
+
parsed = nil
|
70
|
+
@test_driver.instance.parse(text) do |time, record|
|
71
|
+
parsed = [time, record]
|
72
|
+
end
|
73
|
+
parsed
|
74
|
+
end
|
75
|
+
it { is_expected.to contain_exactly(be_an(Fluent::EventTime), { "raw" => "December 12 10:00:00 hostname tag CEF:0|Vendor|Product|Version|ID|Name|Severity|cs1=test" }) }
|
76
|
+
end
|
77
|
+
context "text is syslog format but not CEF" do
|
78
|
+
let (:text) { "Dec 12 10:11:12 hostname tag message" }
|
79
|
+
subject do
|
80
|
+
allow(Fluent::Engine).to receive(:now).and_return(Fluent::EventTime.now)
|
81
|
+
parsed = nil
|
82
|
+
@test_driver.instance.parse(text) do |time, record|
|
83
|
+
parsed = [time, record]
|
84
|
+
end
|
85
|
+
parsed
|
86
|
+
end
|
87
|
+
it { is_expected.to contain_exactly(be_an(Fluent::EventTime), { "raw" => "Dec 12 10:11:12 hostname tag message" }) }
|
88
|
+
end
|
89
|
+
context "text is syslog format and CEF (CEF Extension field is empty)" do
|
90
|
+
let (:text) { "Dec 2 03:17:06 hostname tag CEF:0|Vendor|Product|Version|ID|Name|Severity|" }
|
91
|
+
subject do
|
92
|
+
allow(Fluent::Engine).to receive(:now).and_return(Fluent::EventTime.now)
|
93
|
+
@timestamp = Time.parse("Dec 2 03:17:06").to_i
|
94
|
+
parsed = nil
|
95
|
+
@test_driver.instance.parse(text) do |time, record|
|
96
|
+
parsed = [time, record]
|
97
|
+
end
|
98
|
+
parsed
|
99
|
+
end
|
100
|
+
it { is_expected.to eq [
|
101
|
+
@timestamp, {
|
102
|
+
"syslog_timestamp" => "Dec 2 03:17:06",
|
103
|
+
"syslog_hostname" => "hostname",
|
104
|
+
"syslog_tag" => "tag",
|
105
|
+
"cef_version" => "0",
|
106
|
+
"cef_device_vendor" => "Vendor",
|
107
|
+
"cef_device_product" => "Product",
|
108
|
+
"cef_device_version" => "Version",
|
109
|
+
"cef_device_event_class_id" => "ID",
|
110
|
+
"cef_name" => "Name",
|
111
|
+
"cef_severity" => "Severity" }]}
|
112
|
+
end
|
113
|
+
context "text is syslog format and CEF (there is only one valid key in the CEF Extension field), Strict mode on" do
|
114
|
+
let (:text) { "Dec 2 03:17:06 hostname tag CEF:0|Vendor|Product|Version|ID|Name|Severity|cs1=test" }
|
115
|
+
subject do
|
116
|
+
allow(Fluent::Engine).to receive(:now).and_return(Fluent::EventTime.now)
|
117
|
+
@timestamp = Time.parse("Dec 2 03:17:06").to_i
|
118
|
+
parsed = nil
|
119
|
+
@test_driver.instance.parse(text) do |time, record|
|
120
|
+
parsed = [time, record]
|
121
|
+
end
|
122
|
+
parsed
|
123
|
+
end
|
124
|
+
it { is_expected.to eq [
|
125
|
+
@timestamp, {
|
126
|
+
"syslog_timestamp" => "Dec 2 03:17:06",
|
127
|
+
"syslog_hostname" => "hostname",
|
128
|
+
"syslog_tag" => "tag",
|
129
|
+
"cef_version" => "0",
|
130
|
+
"cef_device_vendor" => "Vendor",
|
131
|
+
"cef_device_product" => "Product",
|
132
|
+
"cef_device_version" => "Version",
|
133
|
+
"cef_device_event_class_id" => "ID",
|
134
|
+
"cef_name" => "Name",
|
135
|
+
"cef_severity" => "Severity",
|
136
|
+
"cs1" => "test" }]}
|
137
|
+
end
|
138
|
+
context "text is syslog format and CEF (there is only one valid key in the CEF Extension field), Strict mode off" do
|
139
|
+
let (:config) {%[
|
140
|
+
parse_strict_mode false
|
141
|
+
]}
|
142
|
+
let (:text) { "Dec 2 03:17:06 hostname tag CEF:0|Vendor|Product|Version|ID|Name|Severity|foo=bar" }
|
143
|
+
subject do
|
144
|
+
allow(Fluent::Engine).to receive(:now).and_return(Fluent::EventTime.now)
|
145
|
+
@timestamp = Time.parse("Dec 2 03:17:06").to_i
|
146
|
+
@test_driver = create_driver(config)
|
147
|
+
parsed = nil
|
148
|
+
@test_driver.instance.parse(text) do |time, record|
|
149
|
+
parsed = [time, record]
|
150
|
+
end
|
151
|
+
parsed
|
152
|
+
end
|
153
|
+
it { is_expected.to eq [
|
154
|
+
@timestamp, {
|
155
|
+
"syslog_timestamp" => "Dec 2 03:17:06",
|
156
|
+
"syslog_hostname" => "hostname",
|
157
|
+
"syslog_tag" => "tag",
|
158
|
+
"cef_version" => "0",
|
159
|
+
"cef_device_vendor" => "Vendor",
|
160
|
+
"cef_device_product" => "Product",
|
161
|
+
"cef_device_version" => "Version",
|
162
|
+
"cef_device_event_class_id" => "ID",
|
163
|
+
"cef_name" => "Name",
|
164
|
+
"cef_severity" => "Severity",
|
165
|
+
"foo" => "bar" }]}
|
166
|
+
end
|
167
|
+
context "text is syslog format and CEF (there is only one valid key in the CEF Extension field), Strict mode on, timestamp is rfc3339" do
|
168
|
+
let (:config) {%[
|
169
|
+
syslog_timestamp_format \\d{4}-{,1}\\d{2}-{,1}\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+){,1}(?:\\Z|\\+\\d{2}:\\d{2})
|
170
|
+
]}
|
171
|
+
let (:text) { "2014-06-07T18:55:09.019283+09:00 hostname tag CEF:0|Vendor|Product|Version|ID|Name|Severity|foo=bar" }
|
172
|
+
subject do
|
173
|
+
allow(Fluent::Engine).to receive(:now).and_return(Fluent::EventTime.now)
|
174
|
+
@timestamp = Time.parse("2014-06-07T18:55:09.019283+09:00").to_i
|
175
|
+
@test_driver = create_driver(config)
|
176
|
+
parsed = nil
|
177
|
+
@test_driver.instance.parse(text) do |time, record|
|
178
|
+
parsed = [time, record]
|
179
|
+
end
|
180
|
+
parsed
|
181
|
+
end
|
182
|
+
it { is_expected.to eq [
|
183
|
+
@timestamp, {
|
184
|
+
"syslog_timestamp" => "2014-06-07T18:55:09.019283+09:00",
|
185
|
+
"syslog_hostname" => "hostname",
|
186
|
+
"syslog_tag" => "tag",
|
187
|
+
"cef_version" => "0",
|
188
|
+
"cef_device_vendor" => "Vendor",
|
189
|
+
"cef_device_product" => "Product",
|
190
|
+
"cef_device_version" => "Version",
|
191
|
+
"cef_device_event_class_id" => "ID",
|
192
|
+
"cef_name" => "Name",
|
193
|
+
"cef_severity" => "Severity" }]}
|
194
|
+
end
|
195
|
+
context "timestamp is rfc3339, UTC+3" do
|
196
|
+
let (:config) {%[
|
197
|
+
syslog_timestamp_format \\d{4}-{,1}\\d{2}-{,1}\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+){,1}(?:\\Z|\\+\\d{2}:\\d{2})
|
198
|
+
]}
|
199
|
+
let (:text) { "2014-06-07T18:55:09.019283+03:00 hostname tag CEF:0|Vendor|Product|Version|ID|Name|Severity|foo=bar" }
|
200
|
+
subject do
|
201
|
+
allow(Fluent::Engine).to receive(:now).and_return(Fluent::EventTime.now)
|
202
|
+
@timestamp = Time.parse("2014-06-07T18:55:09.019283+03:00").to_i
|
203
|
+
@test_driver = create_driver(config)
|
204
|
+
parsed = nil
|
205
|
+
@test_driver.instance.parse(text) do |time, record|
|
206
|
+
parsed = [time, record]
|
207
|
+
end
|
208
|
+
parsed
|
209
|
+
end
|
210
|
+
it { is_expected.to eq [
|
211
|
+
@timestamp, {
|
212
|
+
"syslog_timestamp" => "2014-06-07T18:55:09.019283+03:00",
|
213
|
+
"syslog_hostname" => "hostname",
|
214
|
+
"syslog_tag" => "tag",
|
215
|
+
"cef_version" => "0",
|
216
|
+
"cef_device_vendor" => "Vendor",
|
217
|
+
"cef_device_product" => "Product",
|
218
|
+
"cef_device_version" => "Version",
|
219
|
+
"cef_device_event_class_id" => "ID",
|
220
|
+
"cef_name" => "Name",
|
221
|
+
"cef_severity" => "Severity" }]}
|
222
|
+
end
|
223
|
+
context "timestamp is rfc3339, UTC+0" do
|
224
|
+
let (:config) {%[
|
225
|
+
syslog_timestamp_format \\d{4}-{,1}\\d{2}-{,1}\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+){,1}(?:Z|\\+\\d{2}:\\d{2})
|
226
|
+
]}
|
227
|
+
let (:text) { "2014-06-07T18:55:09.019283Z hostname tag CEF:0|Vendor|Product|Version|ID|Name|Severity|foo=bar" }
|
228
|
+
subject do
|
229
|
+
allow(Fluent::Engine).to receive(:now).and_return(Fluent::EventTime.now)
|
230
|
+
@timestamp = Time.parse("2014-06-07T18:55:09.019283Z").to_i
|
231
|
+
@test_driver = create_driver(config)
|
232
|
+
parsed = nil
|
233
|
+
@test_driver.instance.parse(text) do |time, record|
|
234
|
+
parsed = [time, record]
|
235
|
+
end
|
236
|
+
parsed
|
237
|
+
end
|
238
|
+
it { is_expected.to eq [
|
239
|
+
@timestamp, {
|
240
|
+
"syslog_timestamp" => "2014-06-07T18:55:09.019283Z",
|
241
|
+
"syslog_hostname" => "hostname",
|
242
|
+
"syslog_tag" => "tag",
|
243
|
+
"cef_version" => "0",
|
244
|
+
"cef_device_vendor" => "Vendor",
|
245
|
+
"cef_device_product" => "Product",
|
246
|
+
"cef_device_version" => "Version",
|
247
|
+
"cef_device_event_class_id" => "ID",
|
248
|
+
"cef_name" => "Name",
|
249
|
+
"cef_severity" => "Severity" }]}
|
250
|
+
end
|
251
|
+
context "utc offset set to +04:00" do
|
252
|
+
let (:config) {%[
|
253
|
+
log_utc_offset +04:00
|
254
|
+
]}
|
255
|
+
let (:text) { "Dec 2 03:17:06 hostname tag CEF:0|Vendor|Product|Version|ID|Name|Severity|cs1=test" }
|
256
|
+
subject do
|
257
|
+
allow(Fluent::Engine).to receive(:now).and_return(Fluent::EventTime.now)
|
258
|
+
@timestamp = Time.parse("Dec 2 03:17:06 +04:00").to_i
|
259
|
+
@test_driver = create_driver(config)
|
260
|
+
parsed = nil
|
261
|
+
@test_driver.instance.parse(text) do |time, record|
|
262
|
+
parsed = [time, record]
|
263
|
+
end
|
264
|
+
parsed
|
265
|
+
end
|
266
|
+
it { is_expected.to eq [
|
267
|
+
@timestamp, {
|
268
|
+
"syslog_timestamp" => "Dec 2 03:17:06",
|
269
|
+
"syslog_hostname" => "hostname",
|
270
|
+
"syslog_tag" => "tag",
|
271
|
+
"cef_version" => "0",
|
272
|
+
"cef_device_vendor" => "Vendor",
|
273
|
+
"cef_device_product" => "Product",
|
274
|
+
"cef_device_version" => "Version",
|
275
|
+
"cef_device_event_class_id" => "ID",
|
276
|
+
"cef_name" => "Name",
|
277
|
+
"cef_severity" => "Severity",
|
278
|
+
"cs1" => "test" }]}
|
279
|
+
end
|
280
|
+
context "utc offset set to -11:00, but log timestamp has timezone information, so utc offset is ignored" do
|
281
|
+
let (:config) {%[
|
282
|
+
syslog_timestamp_format \\d{4}-{,1}\\d{2}-{,1}\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+){,1}(?:\\Z|\\+\\d{2}:\\d{2})
|
283
|
+
log_utc_offset -11:00
|
284
|
+
]}
|
285
|
+
let (:text) { "2013-07-24T12:34:56.923984+03:30 hostname tag CEF:0|Vendor|Product|Version|ID|Name|Severity|cs1=test" }
|
286
|
+
subject do
|
287
|
+
allow(Fluent::Engine).to receive(:now).and_return(Fluent::EventTime.now)
|
288
|
+
@timestamp = Time.parse("2013-07-24T12:34:56.923984+03:30").to_i
|
289
|
+
@test_driver = create_driver(config)
|
290
|
+
parsed = nil
|
291
|
+
@test_driver.instance.parse(text) do |time, record|
|
292
|
+
parsed = [time, record]
|
293
|
+
end
|
294
|
+
parsed
|
295
|
+
end
|
296
|
+
it { is_expected.to eq [
|
297
|
+
@timestamp, {
|
298
|
+
"syslog_timestamp" => "2013-07-24T12:34:56.923984+03:30",
|
299
|
+
"syslog_hostname" => "hostname",
|
300
|
+
"syslog_tag" => "tag",
|
301
|
+
"cef_version" => "0",
|
302
|
+
"cef_device_vendor" => "Vendor",
|
303
|
+
"cef_device_product" => "Product",
|
304
|
+
"cef_device_version" => "Version",
|
305
|
+
"cef_device_event_class_id" => "ID",
|
306
|
+
"cef_name" => "Name",
|
307
|
+
"cef_severity" => "Severity",
|
308
|
+
"cs1" => "test" }]}
|
309
|
+
end
|
310
|
+
context "syslog message is UTF-8, with BOM" do
|
311
|
+
let (:config) {%[
|
312
|
+
log_utc_offset -07:00
|
313
|
+
]}
|
314
|
+
let (:text) { "Dec 2 03:17:06 hostname tag ***CEF:0|Vendor|Product|Version|ID|Name|Severity|cs1=test" }
|
315
|
+
subject do
|
316
|
+
allow(Fluent::Engine).to receive(:now).and_return(Fluent::EventTime.now)
|
317
|
+
@timestamp = Time.parse("Dec 2 03:17:06 -07:00").to_i
|
318
|
+
@test_driver = create_driver(config)
|
319
|
+
text.setbyte(29, 0xef)
|
320
|
+
text.setbyte(30, 0xbb)
|
321
|
+
text.setbyte(31, 0xbf)
|
322
|
+
text.force_encoding("ascii-8bit")
|
323
|
+
parsed = nil
|
324
|
+
@test_driver.instance.parse(text) do |time, record|
|
325
|
+
parsed = [time, record]
|
326
|
+
end
|
327
|
+
parsed
|
328
|
+
end
|
329
|
+
it { is_expected.to eq [
|
330
|
+
@timestamp, {
|
331
|
+
"syslog_timestamp" => "Dec 2 03:17:06",
|
332
|
+
"syslog_hostname" => "hostname",
|
333
|
+
"syslog_tag" => "tag",
|
334
|
+
"cef_version" => "0",
|
335
|
+
"cef_device_vendor" => "Vendor",
|
336
|
+
"cef_device_product" => "Product",
|
337
|
+
"cef_device_version" => "Version",
|
338
|
+
"cef_device_event_class_id" => "ID",
|
339
|
+
"cef_name" => "Name",
|
340
|
+
"cef_severity" => "Severity",
|
341
|
+
"cs1" => "test" }]}
|
342
|
+
end
|
343
|
+
context "syslog message is UTF-8, but including invalid UTF-8 string" do
|
344
|
+
let (:config) {%[
|
345
|
+
log_utc_offset +09:00
|
346
|
+
]}
|
347
|
+
let (:text) { "Feb 19 00:35:11 hogehuga CEF:0|Vendor|Product|Version|ID|Name|Severity|src=192.168.1.1 spt=60000 dst=172.16.100.100 dpt=80 msg=\xe3\x2e\x2e\x2e" }
|
348
|
+
subject do
|
349
|
+
allow(Fluent::Engine).to receive(:now).and_return(Fluent::EventTime.now)
|
350
|
+
@timestamp = Time.parse("Feb 19 00:35:11 +09:00").to_i
|
351
|
+
@test_driver = create_driver(config)
|
352
|
+
parsed = nil
|
353
|
+
@test_driver.instance.parse(text) do |time, record|
|
354
|
+
parsed = [time, record]
|
355
|
+
end
|
356
|
+
parsed
|
357
|
+
end
|
358
|
+
it { is_expected.to eq [
|
359
|
+
@timestamp, {
|
360
|
+
"syslog_timestamp" => "Feb 19 00:35:11",
|
361
|
+
"syslog_hostname" => "hogehuga",
|
362
|
+
"syslog_tag" => "",
|
363
|
+
"cef_version" => "0",
|
364
|
+
"cef_device_vendor" => "Vendor",
|
365
|
+
"cef_device_product" => "Product",
|
366
|
+
"cef_device_version" => "Version",
|
367
|
+
"cef_device_event_class_id" => "ID",
|
368
|
+
"cef_name" => "Name",
|
369
|
+
"cef_severity" => "Severity",
|
370
|
+
"src" => "192.168.1.1",
|
371
|
+
"spt" => "60000",
|
372
|
+
"dst" => "172.16.100.100",
|
373
|
+
"dpt" => "80",
|
374
|
+
"msg" => "\xe3\x2e\x2e\x2e".scrub('?') }]}
|
375
|
+
end
|
376
|
+
end
|
377
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<source>
|
2
|
+
@type tail
|
3
|
+
tag develop.cef
|
4
|
+
path /tmp/fluentd/test.log
|
5
|
+
pos_file /tmp/fluentd/test.pos
|
6
|
+
|
7
|
+
format cef
|
8
|
+
#log_format syslog
|
9
|
+
#syslog_timestamp_format '\w{3}\s+\d{1,2}\s\d{2}:\d{2}:\d{2}'
|
10
|
+
#cef_version 0
|
11
|
+
#parse_strict_mode true
|
12
|
+
#cef_keyfilename 'config/cef_version_0_keys.yaml'
|
13
|
+
#output_raw_field false
|
14
|
+
</source>
|
15
|
+
|
16
|
+
<match **>
|
17
|
+
@type stdout
|
18
|
+
</match>
|
19
|
+
|
20
|
+
#<match cevelop.cef>
|
21
|
+
# @type elasticsearch
|
22
|
+
# host elasticsearch
|
23
|
+
# port 9200
|
24
|
+
# logstash_format true
|
25
|
+
# logstash_dateformat %Y.%m.%d
|
26
|
+
# utc_index true
|
27
|
+
# include_tag_key false
|
28
|
+
# logstash_prefix develop
|
29
|
+
# type_name develop
|
30
|
+
# flush_interval 1s
|
31
|
+
#</match>
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
4
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
5
|
+
# files.
|
6
|
+
#
|
7
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
8
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
9
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
10
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
11
|
+
# a separate helper file that requires the additional dependencies and performs
|
12
|
+
# the additional setup, and require it from the spec files that actually need
|
13
|
+
# it.
|
14
|
+
#
|
15
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
16
|
+
# users commonly want.
|
17
|
+
#
|
18
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
19
|
+
|
20
|
+
$LOAD_PATH.unshift(File.expand_path('../lib', __FILE__))
|
21
|
+
$LOAD_PATH.unshift(File.expand_path('../spec', __FILE__))
|
22
|
+
|
23
|
+
require 'simplecov'
|
24
|
+
require 'coveralls'
|
25
|
+
Coveralls.wear!
|
26
|
+
|
27
|
+
SimpleCov.start do
|
28
|
+
add_filter "/spec/"
|
29
|
+
end
|
30
|
+
|
31
|
+
RSpec.configure do |config|
|
32
|
+
# rspec-expectations config goes here. You can use an alternate
|
33
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
34
|
+
# assertions if you prefer.
|
35
|
+
config.expect_with :rspec do |expectations|
|
36
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
37
|
+
# and `failure_message` of custom matchers include text for helper methods
|
38
|
+
# defined using `chain`, e.g.:
|
39
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
40
|
+
# # => "be bigger than 2 and smaller than 4"
|
41
|
+
# ...rather than:
|
42
|
+
# # => "be bigger than 2"
|
43
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
44
|
+
end
|
45
|
+
|
46
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
47
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
48
|
+
config.mock_with :rspec do |mocks|
|
49
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
50
|
+
# a real object. This is generally recommended, and will default to
|
51
|
+
# `true` in RSpec 4.
|
52
|
+
mocks.verify_partial_doubles = true
|
53
|
+
end
|
54
|
+
|
55
|
+
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
56
|
+
# have no way to turn it off -- the option exists only for backwards
|
57
|
+
# compatibility in RSpec 3). It causes shared context metadata to be
|
58
|
+
# inherited by the metadata hash of host groups and examples, rather than
|
59
|
+
# triggering implicit auto-inclusion in groups with matching metadata.
|
60
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
61
|
+
|
62
|
+
# The settings below are suggested to provide a good initial experience
|
63
|
+
# with RSpec, but feel free to customize to your heart's content.
|
64
|
+
=begin
|
65
|
+
# This allows you to limit a spec run to individual examples or groups
|
66
|
+
# you care about by tagging them with `:focus` metadata. When nothing
|
67
|
+
# is tagged with `:focus`, all examples get run. RSpec also provides
|
68
|
+
# aliases for `it`, `describe`, and `context` that include `:focus`
|
69
|
+
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
70
|
+
config.filter_run_when_matching :focus
|
71
|
+
|
72
|
+
# Allows RSpec to persist some state between runs in order to support
|
73
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
74
|
+
# you configure your source control system to ignore this file.
|
75
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
76
|
+
|
77
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
78
|
+
# recommended. For more details, see:
|
79
|
+
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
80
|
+
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
81
|
+
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
82
|
+
config.disable_monkey_patching!
|
83
|
+
|
84
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
85
|
+
# be too noisy due to issues in dependencies.
|
86
|
+
config.warnings = true
|
87
|
+
|
88
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
89
|
+
# file, and it's useful to allow more verbose output when running an
|
90
|
+
# individual spec file.
|
91
|
+
if config.files_to_run.one?
|
92
|
+
# Use the documentation formatter for detailed output,
|
93
|
+
# unless a formatter has already been configured
|
94
|
+
# (e.g. via a command-line flag).
|
95
|
+
config.default_formatter = 'doc'
|
96
|
+
end
|
97
|
+
|
98
|
+
# Print the 10 slowest examples and example groups at the
|
99
|
+
# end of the spec run, to help surface which specs are running
|
100
|
+
# particularly slow.
|
101
|
+
config.profile_examples = 10
|
102
|
+
|
103
|
+
# Run specs in random order to surface order dependencies. If you find an
|
104
|
+
# order dependency and want to debug it, you can fix the order by providing
|
105
|
+
# the seed, which is printed after each run.
|
106
|
+
# --seed 1234
|
107
|
+
#config.order = :random
|
108
|
+
|
109
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
110
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
111
|
+
# test failures related to randomization by passing the same `--seed` value
|
112
|
+
# as the one that triggered the failure.
|
113
|
+
Kernel.srand config.seed
|
114
|
+
=end
|
115
|
+
end
|
116
|
+
|
metadata
ADDED
@@ -0,0 +1,154 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fluent-plugin-parser_cefalt
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.6
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tomoyuki Sugimura
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2025-04-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: fluentd
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.14.0
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '2'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.14.0
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: bundler
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '1.3'
|
40
|
+
type: :development
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '1.3'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rake
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rspec
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '3.0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '3.0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rspec-core
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: test-unit
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
description: common event format(CEF) parser plugin for fluentd
|
104
|
+
email:
|
105
|
+
- tomoyuki.sugimura@gmail.com
|
106
|
+
executables: []
|
107
|
+
extensions: []
|
108
|
+
extra_rdoc_files: []
|
109
|
+
files:
|
110
|
+
- ".codeclimate.yml"
|
111
|
+
- ".coveralls.yml"
|
112
|
+
- ".gitignore"
|
113
|
+
- ".rspec"
|
114
|
+
- ".rubocop.yml"
|
115
|
+
- ".travis.yml"
|
116
|
+
- Gemfile
|
117
|
+
- LICENSE
|
118
|
+
- README.md
|
119
|
+
- Rakefile
|
120
|
+
- VERSION
|
121
|
+
- fluent-plugin-parser_cefalt.gemspec
|
122
|
+
- lib/fluent/plugin/config/cef_version_0_keys.yaml
|
123
|
+
- lib/fluent/plugin/parser_cefalt.rb
|
124
|
+
- spec/fluent/plugin/parser_cefalt_spec.rb
|
125
|
+
- spec/sample/fluentd.conf
|
126
|
+
- spec/spec_helper.rb
|
127
|
+
homepage: https://github.com/lunardial/fluent-plugin-parser_cef
|
128
|
+
licenses:
|
129
|
+
- MIT
|
130
|
+
metadata: {}
|
131
|
+
post_install_message:
|
132
|
+
rdoc_options: []
|
133
|
+
require_paths:
|
134
|
+
- lib
|
135
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '2.1'
|
140
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
145
|
+
requirements: []
|
146
|
+
rubygems_version: 3.0.3.1
|
147
|
+
signing_key:
|
148
|
+
specification_version: 4
|
149
|
+
summary: common event format(CEF) parser plugin, currently only 'syslog' format is
|
150
|
+
permitted
|
151
|
+
test_files:
|
152
|
+
- spec/fluent/plugin/parser_cefalt_spec.rb
|
153
|
+
- spec/sample/fluentd.conf
|
154
|
+
- spec/spec_helper.rb
|