diff --git a/filebeat/input/journald/config_test.go b/filebeat/input/journald/config_test.go index 685cbdd9095..9dfdd91ae95 100644 --- a/filebeat/input/journald/config_test.go +++ b/filebeat/input/journald/config_test.go @@ -25,6 +25,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + conf "github.com/elastic/elastic-agent-libs/config" ) func TestConfigIncludeMatches(t *testing.T) { @@ -34,11 +36,11 @@ func TestConfigIncludeMatches(t *testing.T) { c, err := conf.NewConfigWithYAML([]byte(yml), "source") require.NoError(t, err) - conf := defaultConfig() - require.NoError(t, c.Unpack(&conf)) + config := defaultConfig() + require.NoError(t, c.Unpack(&config)) - assert.EqualValues(t, "_SYSTEMD_UNIT=foo.service", conf.Matches.OR[0].Matches[0].String()) - assert.EqualValues(t, "_SYSTEMD_UNIT=bar.service", conf.Matches.OR[1].Matches[0].String()) + assert.EqualValues(t, "_SYSTEMD_UNIT=foo.service", config.Matches.OR[0].Matches[0].String()) + assert.EqualValues(t, "_SYSTEMD_UNIT=bar.service", config.Matches.OR[1].Matches[0].String()) } t.Run("normal", func(t *testing.T) { diff --git a/filebeat/input/journald/environment_test.go b/filebeat/input/journald/environment_test.go index f77ce285876..c3960314812 100644 --- a/filebeat/input/journald/environment_test.go +++ b/filebeat/input/journald/environment_test.go @@ -36,6 +36,7 @@ import ( "github.com/elastic/beats/v7/libbeat/logp" "github.com/elastic/beats/v7/libbeat/statestore" "github.com/elastic/beats/v7/libbeat/statestore/storetest" + conf "github.com/elastic/elastic-agent-libs/config" "github.com/elastic/go-concert/unison" ) diff --git a/filebeat/input/journald/input.go b/filebeat/input/journald/input.go index 956c980e330..855c98707d4 100644 --- a/filebeat/input/journald/input.go +++ b/filebeat/input/journald/input.go @@ -35,6 +35,7 @@ import ( "github.com/elastic/beats/v7/libbeat/logp" "github.com/elastic/beats/v7/libbeat/reader" "github.com/elastic/beats/v7/libbeat/reader/parser" + conf "github.com/elastic/elastic-agent-libs/config" ) type journald struct { @@ -105,7 +106,7 @@ func configure(cfg *conf.C) ([]cursor.Source, cursor.Input, error) { Backoff: config.Backoff, MaxBackoff: config.MaxBackoff, Seek: config.Seek, - CursorSeekFallback: conf.CursorSeekFallback, + CursorSeekFallback: config.CursorSeekFallback, Matches: journalfield.IncludeMatches(config.Matches), Units: config.Units, Transports: config.Transports,