Last active
August 29, 2015 14:21
-
-
Save paveljurca/883c1ca596b9e7c7070f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use 5.010.1; | |
my $msg; | |
my $break = qr/^AMQ\d+/; | |
while (<DATA>) { | |
chomp; | |
if ($break .. $break) { | |
if (/($break)/) { | |
# $1 is now the ID | |
$msg .= 'the queue is '; | |
next; | |
} | |
/^QUEUE\(([^)]+)/ | |
and $msg .= $1; | |
/^CURDEPTH\(([^)]+)/ | |
and $msg .= " and depth is $1\n"; | |
} | |
} | |
say for split /\n/, $msg; | |
__DATA__ | |
AMQ8409: Display Queue details. | |
QUEUE(SYSTEM.ADMIN.QMGR.EVENT) TYPE(QLOCAL) | |
CURDEPTH(1) | |
AMQ8409: Display Queue details. | |
QUEUE(SYSTEM.AUTH.DATA.QUEUE) TYPE(QLOCAL) | |
CURDEPTH(102) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment