Skip to content

Commit

Permalink
Merge pull request #1510 from balabit/journal-fix-for-prefix-option
Browse files Browse the repository at this point in the history
systemd-journal: fix prefix() default for new config versions
  • Loading branch information
lbudai committed May 31, 2017
2 parents 282ec7c + 2c6eba5 commit 5f2f4ed
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions modules/systemd-journal/journal-reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,18 +623,21 @@ journal_reader_options_init(JournalReaderOptions *options, GlobalConfig *cfg, co
if (options->recv_time_zone_info == NULL)
options->recv_time_zone_info = time_zone_info_new(options->recv_time_zone);

gchar *value = ".journald.";
if (options->prefix == NULL && cfg_is_config_version_older(cfg, VERSION_VALUE_3_8))
{
msg_warning("WARNING: Default value changed for the prefix() option of systemd-journal source in " VERSION_3_8,
evt_tag_str("old_value", ""),
evt_tag_str("new_value", value));
}
else if (!cfg_is_config_version_older(cfg, VERSION_VALUE_3_8))

if (options->prefix == NULL)
{
options->prefix = g_strdup(value);
gchar *default_prefix = ".journald.";
if (cfg_is_config_version_older(cfg, VERSION_VALUE_3_8))
{
msg_warning("WARNING: Default value changed for the prefix() option of systemd-journal source in " VERSION_3_8,
evt_tag_str("old_value", ""),
evt_tag_str("new_value", default_prefix));
}
else
{
options->prefix = g_strdup(default_prefix);
}
}

options->initialized = TRUE;
}

Expand Down

0 comments on commit 5f2f4ed

Please sign in to comment.