Fix on empty log extraction

This commit is contained in:
Félix Suárez 2024-02-02 08:56:39 -06:00
parent ebff3ff753
commit b9070d3a8e
1 changed files with 7 additions and 10 deletions

View File

@ -3680,20 +3680,17 @@ sub write_module_xml ($@) {
# Is it an extraction log module? # Is it an extraction log module?
if($module->{'type'} eq "log"){ if($module->{'type'} eq "log"){
my $output = join('', @data);
if ($output eq "") {
return;
}
$Xml .="<log_module>\n"; $Xml .="<log_module>\n";
$Xml .= " <source><![CDATA[" . $module->{'name'} . "]]></source>\n"; $Xml .= " <source><![CDATA[" . $module->{'name'} . "]]></source>\n";
$Xml .= " <type><![CDATA[" . $module->{'type'} . "]]></type>\n"; $Xml .= " <type><![CDATA[" . $module->{'type'} . "]]></type>\n";
$Xml .= " <encoding>base64</encoding>\n"; $Xml .= " <encoding>base64</encoding>\n";
$Xml .= " <data><![CDATA[" . $output . "]]></data>\n";
# Data list
if ($#data > 0) {
$Xml .= " <data><![CDATA[" . join('', @data) . "]]></data>\n";
# Single data
} else {
chomp ($data[0]);
$Xml .= " <data><![CDATA[$data[0]]]></data>\n";
}
$Xml .= "</log_module>\n"; $Xml .= "</log_module>\n";
return; return;
} }