Add NO_HOST_DOMAIN configuration directive. When activated, remove domain part

of the syslog hostname. Some programme use FQDN instead of the single hostname.
Set it to 1 if you have two report for the same hostname but one with the domain
part.
This commit is contained in:
Darold Gilles 2016-05-04 22:04:34 +12:00
parent e43a96c25d
commit bb2a958d03
2 changed files with 10 additions and 0 deletions

View file

@ -312,6 +312,12 @@ EXCLUDE_RELAY addr1\@domain1.com|addr2\@domain2.com
# When enabled it allow email subjects to be shown in detailed view. Of course
# The log file must contain this information.
SHOW_SUBJECT 0
# When activated, remove domain part of the syslog hostname. Some programme
# use FQDN instead of the single hostname. Set it to 1 if you have two report
# for the same hostname but one with the domain part.
NO_HOST_DOMAIN 0
};
close(OUTCFG);

View file

@ -459,6 +459,10 @@ sub parse_common_fields
# Get current system time
my $ctime = &format_time(localtime(time));
# Remove domain part of the host
if ($CONFIG{NO_HOST_DOMAIN}) {
$host =~ s/\..*//;
}
my $date = '';
if ($month =~ /(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)/) {
$date = "$1$2$3";