From 931610e7744d787933cb03cdb6958066c4f9d8bb Mon Sep 17 00:00:00 2001 From: alejandro Date: Wed, 15 Mar 2023 17:23:59 +0100 Subject: [PATCH] fix to correctly take the path of the logs to be monitored. --- pandora_plugins/Advanced Log Parser/pandora_logparser.pl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pandora_plugins/Advanced Log Parser/pandora_logparser.pl b/pandora_plugins/Advanced Log Parser/pandora_logparser.pl index b83ad3477f..3f4dc7ac2f 100644 --- a/pandora_plugins/Advanced Log Parser/pandora_logparser.pl +++ b/pandora_plugins/Advanced Log Parser/pandora_logparser.pl @@ -743,8 +743,12 @@ while (my ($key, $value) = each (@{$plugin_setup{"log"}})) { if (defined($value->{"log_location_multiple"})){ $log_filename_multiple = $value->{"log_location_multiple"}; $log_create_module_for_each_log = $value->{"module_for_each_log"}; - #my @buffer = `dir "$log_filename_multiple" /b /a-d`; - my @buffer = `ls -d "$log_filename_multiple"`; + my @buffer; + if($^O =~ /win/i){ + @buffer = `dir "$log_filename_multiple" /b /a-d`; + }else{ + @buffer = `ls -d "$log_filename_multiple"`; + } foreach (@buffer) { # This should solve problems with carriage return in Unix, Linux and Windooze chomp($_); @@ -757,6 +761,7 @@ while (my ($key, $value) = each (@{$plugin_setup{"log"}})) { $module_name_multiple =~ s/\//_/g; $module_name_multiple = $module_name . "_" . $module_name_multiple; } + $log_filename = $log_filename_multiple . $_; manage_logfile ($log_filename, $module_name_multiple, $readall, $type, $regexp, $description); } }