diff --git a/lib/SLUB/LZA/Rosetta/TA/Command/log.pm b/lib/SLUB/LZA/Rosetta/TA/Command/log.pm index 7810057af4b00214bfb14fba44321025916251d6..df68b3bbee15b4a9f06303aa3f48ea905d319668 100644 --- a/lib/SLUB/LZA/Rosetta/TA/Command/log.pm +++ b/lib/SLUB/LZA/Rosetta/TA/Command/log.pm @@ -35,11 +35,9 @@ sub opt_spec { ["colorize|c" => "colorize output"], ["csv" => "use csv output"], ]}], - ["datemode" => hidden => {one_of => [ - ["last-24h" => "search within last 24h"], - ["fromdate=s" => "search starting with date"], - ["todate=s" => "search ending with date"], - ] } ], + ["last-24h" => "search within last 24h"], + ["fromdate=s" => "search starting with date"], + ["todate=s" => "search ending with date"], ["level=s@" => "levels to search for. Levels could be: 'error', 'warn', 'info', debug. You could use multiple levels by repeating"], ["match=s" => "perl regex to search for" => {default=>".*"}], ); @@ -124,9 +122,9 @@ sub create_regex_from_to { || $line =~ s/ (INFO) / ${green}$1${reset} / || $line =~ s/ (WARN) / ${red}$1${reset} / || $line =~ s/ (ERROR) / ${bred}$1${reset} /; - $line =~ s/(SIP ?\d+)/${back_yellow}$1${reset}/; - $line =~ s/(IE ?\d+)/${back_yellow}$1${reset}/; - $line =~ s/(dc.identifier)/${back_cyan}$1${reset}/; + $line =~ s/(SIP ?\d+)/${back_yellow}$1${reset}/g; + $line =~ s/(IE ?\d+)/${back_yellow}$1${reset}/g; + $line =~ s/(dc.identifier)/${back_cyan}$1${reset}/g; return $line; } } @@ -164,12 +162,7 @@ sub execute { my $date_rx=qr/[^ ]*/; if (defined $opt->last_24h and $opt->last_24h == 1) { $date_rx=create_regex_last24h(); - } elsif (defined $opt->datemode - and ( - $opt->datemode eq "todate" - or $opt->datemode eq "fromdate" - ) - ) { + } else { $date_rx=create_regex_from_to($opt->fromdate, $opt->todate); } # create level_rx if multiple levels provided by CLI