Skip to content

Commit e391132

Browse files
committed
Remove deprecated strip_underscores config option
1 parent 88c64bd commit e391132

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

lib/fluent/plugin/in_systemd.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ class SystemdInput < Input
1717
config_param :path, :string, default: '/var/log/journal'
1818
config_param :filters, :array, default: []
1919
config_param :read_from_head, :bool, default: false
20-
config_param :strip_underscores, :bool, default: false, deprecated: 'Use <entry> section or `systemd_entry` ' \
21-
'filter plugin instead'
2220
config_param :tag, :string
2321

2422
config_section :storage do
@@ -38,10 +36,7 @@ def configure(conf)
3836
super
3937
@journal = nil
4038
@pos_storage = storage_create(usage: 'positions')
41-
# legacy strip_underscores backwards compatibility (legacy takes
42-
# precedence and is mutually exclusive with the entry block)
43-
mut_opts = @strip_underscores ? { fields_strip_underscores: true } : @entry_opts.to_h
44-
@mutator = SystemdEntryMutator.new(**mut_opts)
39+
@mutator = SystemdEntryMutator.new(**@entry_opts.to_h)
4540
@mutator.warnings.each { |warning| log.warn(warning) }
4641
end
4742

test/plugin/test_in_systemd.rb

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ def setup
6565
read_from_head true
6666
)
6767

68-
# deprecated
69-
@strip_config = base_config + %(
70-
strip_underscores true
71-
)
72-
7368
@storage_path = File.join(Dir.mktmpdir('pos_dir'), 'storage.json')
7469

7570
@storage_config = @base_config + %(
@@ -99,7 +94,7 @@ def setup
9994
end
10095

10196
attr_reader :journal, :base_config, :head_config,
102-
:filter_config, :strip_config, :tail_config, :not_present_config,
97+
:filter_config, :tail_config, :not_present_config,
10398
:badmsg_config, :storage_path, :storage_config
10499

105100
def create_driver(config)
@@ -149,18 +144,6 @@ def test_reading_from_the_journal_tail_mutate_entry(data)
149144
assert_equal(expected, d.events)
150145
end
151146

152-
# deprecated config option for backwards compatibility
153-
def test_reading_from_the_journal_tail_with_strip_underscores_legacy
154-
d = create_driver(strip_config)
155-
expected = [[
156-
'test',
157-
1_364_519_243,
158-
EntryTestData::EXPECTED[:fields_strip_underscores]
159-
]]
160-
d.run(expect_emits: 1)
161-
assert_equal(expected, d.events)
162-
end
163-
164147
def test_storage_file_is_written
165148
d = create_driver(storage_config)
166149
d.run(expect_emits: 1)

0 commit comments

Comments
 (0)