N
Nene
Hi,
I want to disregard the first match of the 'm/State : (\S+)/'
which would be the string 'Availability' because the first match is
meaningless, the other matches of Availability are important. So how I
do disregard/omit the first capture of a loop?
####
#!/usr/bin/perl -w
use strict;
while ( my $line = <DATA> ) {
if ($line =~ m/Ltm:ool Member: \S+ (\S+)/) {
$a = $1;
}
if ($line =~ m/State : (\S+)/) {
$b = $1;
print "$a $b\n";
}
}
__DATA__
Ltm:ool: TEST_POOL
--------------------------------------
Status
Availability : available
State : enabled
Reason : The pool is available
^M
Traffic ServerSide
Bits In 4.1G
Bits Out 0
Packets In 4.8M
Packets Out 0
Current Connections 0
Maximum Connections 153
Total Connections 723.4K
Ltm:ool Member: TEST_POOL 10.10.10.10:7502
-------------------------------------------------
tatus
Availability : available
State : enabled
Reason : Pool member is available
Traffic ServerSide General
Bits In 522.8M -
Bits Out 0 -
Packets In 614.2K -
Packets Out 0 -
Current Connections 0 -
Maximum Connections 20 -
Total Connections 90.9K -
Total Requests - 0
Ltm:ool Member: TEST_POOL 10.10.10.10:7502
I want to disregard the first match of the 'm/State : (\S+)/'
which would be the string 'Availability' because the first match is
meaningless, the other matches of Availability are important. So how I
do disregard/omit the first capture of a loop?
####
#!/usr/bin/perl -w
use strict;
while ( my $line = <DATA> ) {
if ($line =~ m/Ltm:ool Member: \S+ (\S+)/) {
$a = $1;
}
if ($line =~ m/State : (\S+)/) {
$b = $1;
print "$a $b\n";
}
}
__DATA__
Ltm:ool: TEST_POOL
--------------------------------------
Status
Availability : available
State : enabled
Reason : The pool is available
^M
Traffic ServerSide
Bits In 4.1G
Bits Out 0
Packets In 4.8M
Packets Out 0
Current Connections 0
Maximum Connections 153
Total Connections 723.4K
Ltm:ool Member: TEST_POOL 10.10.10.10:7502
-------------------------------------------------
tatus
Availability : available
State : enabled
Reason : Pool member is available
Traffic ServerSide General
Bits In 522.8M -
Bits Out 0 -
Packets In 614.2K -
Packets Out 0 -
Current Connections 0 -
Maximum Connections 20 -
Total Connections 90.9K -
Total Requests - 0
Ltm:ool Member: TEST_POOL 10.10.10.10:7502