2015-12-04 12:11:08 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'fluentd::source' do
|
2017-08-17 11:34:13 +00:00
|
|
|
on_supported_os.each do |os, facts|
|
|
|
|
context "on #{os}" do
|
|
|
|
let :facts do
|
|
|
|
facts
|
|
|
|
end
|
2015-12-04 12:11:08 +00:00
|
|
|
|
2017-08-17 11:34:13 +00:00
|
|
|
let(:pre_condition) { 'include fluentd' }
|
|
|
|
|
|
|
|
describe 'basic source' do
|
|
|
|
let(:title) { 'test' }
|
|
|
|
let(:params) do
|
|
|
|
{
|
2018-01-17 10:22:32 +00:00
|
|
|
priority: 10,
|
2017-08-17 11:34:13 +00:00
|
|
|
config: {
|
|
|
|
'type' => 'tail',
|
|
|
|
'format' => 'json',
|
|
|
|
'path' => '/var/log/test-application/*.json',
|
2018-03-02 22:32:51 +00:00
|
|
|
'parse' => {
|
|
|
|
'type' => 'regexp',
|
|
|
|
'expression' => '^(?<name>[^ ]*) (?<user>[^ ]*) (?<age>\d*)$'
|
|
|
|
},
|
|
|
|
'storage'=> {
|
|
|
|
'type' => 'local',
|
|
|
|
'path' => 'test.pos'
|
|
|
|
},
|
2017-08-17 11:34:13 +00:00
|
|
|
'tag' => 'application.test'
|
|
|
|
}
|
2015-12-04 12:11:08 +00:00
|
|
|
}
|
2017-08-17 11:34:13 +00:00
|
|
|
end
|
2015-12-04 12:11:08 +00:00
|
|
|
|
2017-08-17 11:34:13 +00:00
|
|
|
it do
|
|
|
|
is_expected.to contain_file('/etc/td-agent/conf.d/10-source-test.conf').
|
|
|
|
with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/source_tail.conf')))
|
|
|
|
end
|
|
|
|
end
|
2015-12-04 12:11:08 +00:00
|
|
|
end
|
|
|
|
end
|
2017-08-03 10:00:59 +00:00
|
|
|
end
|