2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 23:06:37 +00:00

93_Log2Syslog: contrib V4.8.5

git-svn-id: https://svn.fhem.de/fhem/trunk@17182 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2018-08-20 17:24:43 +00:00
parent dc8b49f515
commit 74f0549925

View File

@ -30,6 +30,7 @@
######################################################################################################################
# Versions History:
#
# 4.8.5 20.08.2018 BSD parsing changed, BSD setpayload changed
# 4.8.4 15.08.2018 BSD parsing changed
# 4.8.3 14.08.2018 BSD setpayload changed, BSD parsing changed, Internal MYFQDN
# 4.8.2 13.08.2018 rename makeMsgEvent to makeEvent
@ -85,7 +86,7 @@ eval "use Net::Domain qw(hostname hostfqdn hostdomain domainname);1" or my $Mis
#
sub Log2Syslog_Log3slog($$$);
my $Log2SyslogVn = "4.8.4";
my $Log2SyslogVn = "4.8.5";
# Mappinghash BSD-Formatierung Monat
my %Log2Syslog_BSDMonth = (
@ -507,7 +508,7 @@ sub Log2Syslog_parsePayload($$) {
$tail =~ /^(?<host>[^\s]*)?\s(?<tail>.*)$/;
$host = $+{host}; # should
$tail = $+{tail};
$tail =~ /^(?<id>[\w\s]*)?(?<cont>\W.*)$/;
$tail =~ /^(?<id>(\w*))?(?<cont>(\[\w*\]:|:\s).*)$/;
$id = $+{id}; # should
if($id) {
$id = substr($id,0, ($RFC3164len{TAG}-1)); # Länge TAG-Feld nach RFC begrenzen
@ -1384,8 +1385,8 @@ sub Log2Syslog_setpayload ($$$$$$) {
$day =~ s/0/ / if($day =~ m/^0.*$/); # in Tagen < 10 muss 0 durch Space ersetzt werden
$ident = substr($ident,0, $RFC3164len{TAG}); # Länge TAG Feld begrenzen
no warnings 'uninitialized';
$ident = $ident."[$hash->{SEQNO}]:";
$data = "<$prival>$month $day $time $myhost $ident $tag$otp";
$ident = $ident.$tag."[$pid]:";
$data = "<$prival>$month $day $time $myhost $ident$otp";
use warnings;
$data = substr($data,0, ($RFC3164len{DL}-1)); # Länge Total begrenzen
}