Skip to content

Commit

Permalink
iHealth API compatibility fixes + improvements
Browse files Browse the repository at this point in the history
updated for iHealth API compatibility fixes and added small improvements
in error handling
  • Loading branch information
simonkowallik committed Mar 12, 2017
1 parent 6b8ccf1 commit 281db38
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 67 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ OK
### ihac-qkviewadd
Adds qkview to iHealth, qkview file supplied as argument. You can specify as many qkviews as arguments as you want.
```sh
simon@bigip ~ $ ihac-qkviewadd ../qkviews/bigip1141.qkview ../qkviews/bigip1151.qkview ../qkviews/bigip1160.qkview
simon@bigip ~ $ ihac-qkviewadd ../bigip1141.qkview ./bigip1151.qkview bigip1160.qkview
################################################################## 100.0%
2257810 OK
################################################################## 100.0%
Expand All @@ -134,10 +134,10 @@ simon@bigip ~ $ cat ../qkviews/bigip1151.qkview | ihac-qkviewadd
Lists all qkviews available on iHealth
```sh
simon@bigip ~ $ ihac-qkviewlist
2257819 bigip1151.example.com SerialNumber May 8 2014, 21:12:29 AM (GMT) OptionalCaseNumber
2257811 bigip1151.example.com SerialNumber May 8 2014, 21:10:19 AM (GMT) OptionalCaseNumber
2254055 bigip1151.example.com SerialNumber May 7 2014, 20:59:32 AM (GMT) OptionalCaseNumber
2254011 bigip1151.example.com SerialNumber May 7 2014, 20:32:39 AM (GMT) OptionalCaseNumber
2257819 bigip1151.example.com SerialNumber May 8 2014, 21:12:29 AM (GMT) OptionalCaseNumber
2257811 bigip1151.example.com SerialNumber May 8 2014, 21:10:19 AM (GMT) OptionalCaseNumber
2254055 bigip1151.example.com SerialNumber May 7 2014, 20:59:32 AM (GMT) OptionalCaseNumber
2254011 bigip1151.example.com SerialNumber May 7 2014, 20:32:39 AM (GMT) OptionalCaseNumber
```
The first column displays the qkview ID, which is important for all commands below.

Expand Down Expand Up @@ -310,11 +310,11 @@ simon@bigip ~ $ rm -f $HOME/.ihac/auth.jar
# Usage Examples
Pipe credentials from local to remote system for authentication and list all qkviews available on iHealth
```sh
~ $ cat $HOME/auth.txt | ssh [email protected] '/root/bin/ihac-auth; /root/bin/ihac-qkviewlist'
~ $ cat $HOME/auth.txt | ssh [email protected] '/root/bin/ihac-auth;/root/bin/ihac-qkviewlist'
Password:
OK
2483776 bigip.example.com 0570271 Jun 30 2014, 06:59:43 PM (GMT)
2483760 bigip.example.com 0570271 Jun 30 2014, 06:54:47 PM (GMT)
2483776 bigip.example.com 0570271 Jun 30 2014, 06:59:43 PM (GMT)
2483760 bigip.example.com 0570271 Jun 30 2014, 06:54:47 PM (GMT)
```
Pipe local qkview file to remote system and upload to iHealth
Expand Down
9 changes: 7 additions & 2 deletions ihac-auth
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
#version: 1.2
#version: 2.0
#license: MIT
#author: Simon Kowallik <github simonkowallik.com>
#source: https://github.com/simonkowallik/iHAC
Expand All @@ -26,6 +26,8 @@ function urlencode() {
done
}

command -v curl >/dev/null 2>&1 || { echoerr "Error: $(basename $0) requires curl but it is not installed."; exit 1; }

if [[ -z "$1" ]] && [[ -t 0 ]]
then
echo -n "Username: "
Expand All @@ -41,6 +43,9 @@ else
if [[ -f "$IHACAUTH" ]]; then rm -f "$IHACAUTH"; fi
echo "OK"
exit 0
elif [[ ! -z "$1" ]] && [[ -s "$1" ]]
then
USRPW=$(<$1)
elif [[ ! -z "$1" ]]
then
USRPW=$1
Expand All @@ -54,7 +59,7 @@ else
fi
fi

result=`curl -si$IHACPROXY --user-agent "iHAC/1.0" --cookie-jar "$IHACAUTH" \
result=`curl -si$IHACPROXY --user-agent "iHAC/2.0" --cookie-jar "$IHACAUTH" \
--data $USRPW \
-o - https://login.f5.com/resource/loginAction.jsp \
| sort -r \
Expand Down
8 changes: 6 additions & 2 deletions ihac-commandlist
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
#version: 1.1
#version: 2.0
#license: MIT
#author: Simon Kowallik <github simonkowallik.com>
#source: https://github.com/simonkowallik/iHAC
Expand All @@ -11,9 +11,13 @@ if [[ ! -z "$IHACPROXY" ]]; then IHACPROXY="x $IHACPROXY"; fi

function echoerr() { echo "$@" 1>&2; }

command -v perl >/dev/null 2>&1 || { echoerr "Error: $(basename $0) requires perl but it is not installed."; exit 1; }
command -v curl >/dev/null 2>&1 || { echoerr "Error: $(basename $0) requires curl but it is not installed."; exit 1; }


if [[ -n "$1" ]] && [[ "$1" =~ ^[0-9]+$ ]]
then
curl -si$IHACPROXY -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/1.0" \
curl -si$IHACPROXY -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/2.0" \
--cookie "$IHACAUTH" --cookie-jar "$IHACAUTH" \
-o - https://ihealth-api.f5.com/qkview-analyzer/api/qkviews/$1/commands \
| perl -ne 's/\r\n//g;
Expand Down
7 changes: 5 additions & 2 deletions ihac-commandrun
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
#version: 1.2
#version: 2.0
#license: MIT
#author: Simon Kowallik <github simonkowallik.com>
#source: https://github.com/simonkowallik/iHAC
Expand All @@ -11,6 +11,9 @@ if [[ ! -z "$IHACPROXY" ]]; then IHACPROXY="x $IHACPROXY"; fi

function echoerr() { echo "$@" 1>&2; }

command -v perl >/dev/null 2>&1 || { echoerr "Error: $(basename $0) requires perl but it is not installed."; exit 1; }
command -v curl >/dev/null 2>&1 || { echoerr "Error: $(basename $0) requires curl but it is not installed."; exit 1; }

if [[ -n "$1" ]] && [[ "$1" =~ ^[0-9]+$ ]] && [[ -n "$2" ]]
then
if command -v sha1sum > /dev/null
Expand All @@ -19,7 +22,7 @@ then
else
cmdid=(`echo -n $2 | shasum`)
fi
curl -si$IHACPROXY -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/1.0" \
curl -si$IHACPROXY -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/2.0" \
--cookie "$IHACAUTH" --cookie-jar "$IHACAUTH" \
-o - https://ihealth-api.f5.com/qkview-analyzer/api/qkviews/$1/commands/${cmdid[0]} \
| perl -MMIME::Base64 -ne 's/[\r\n]+//g;
Expand Down
61 changes: 35 additions & 26 deletions ihac-diagnostics
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
#version: 1.1
#version: 2.0
#license: MIT
#author: Simon Kowallik <github simonkowallik.com>
#source: https://github.com/simonkowallik/iHAC
Expand All @@ -11,35 +11,44 @@ if [[ ! -z "$IHACPROXY" ]]; then IHACPROXY="x $IHACPROXY"; fi

function echoerr() { echo "$@" 1>&2; }

command -v perl >/dev/null 2>&1 || { echoerr "Error: $(basename $0) requires perl but it is not installed."; exit 1; }
command -v curl >/dev/null 2>&1 || { echoerr "Error: $(basename $0) requires curl but it is not installed."; exit 1; }

if [[ -n "$1" ]] && [[ "$1" =~ ^[0-9]+$ ]]
then
curl -si$IHACPROXY -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/1.0" \
curl -si$IHACPROXY -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/2.0" \
--cookie "$IHACAUTH" --cookie-jar "$IHACAUTH" \
-o - https://ihealth-api.f5.com/qkview-analyzer/api/qkviews/$1/diagnostics?set=all \
| perl -ne 's/\r\n//g;
if(m|http/1.. 200|gi) {$ok=1} else {
if(m|http/1.. 30\d|gi) {print STDERR "Error: not authenticated.\n";exit 1}
if(m|http/1.. 404|gi) {print STDERR "Error: qkview ID not found.\n";exit 1}
}
if($ok && m/<\?xml/gi) {
use XML::Simple;
eval {$xml = new XML::Simple->XMLin($_)};
if ($@) {print STDERR "Error: Could not parse XML: $@\n";exit 1}
$hs_ver = $xml->{version}; $hs_sys = $xml->{system_information};
print "Hostname: $hs_sys->{hostname}\t Serial: $hs_sys->{bigip_chassis_serial_num}\n";
print "Version: $hs_ver->{version} $hs_ver->{edition}\t Platform: $hs_sys->{platform}\n\n";
$diag = $xml->{diagnostics}->{diagnostic};
foreach $hs ( sort { reverse($diag->{$a}->{run_data}->{h_importance}) cmp reverse($diag->{$b}->{run_data}->{h_importance}) } keys %{$diag} ) {
next if($diag->{$hs}->{run_data}->{match} eq "false");
$hs_r = $diag->{$hs}->{results}; $hs_s = $hs_r->{h_sols}->{solution};
print "* Severity: $diag->{$hs}->{run_data}->{h_importance} \tHeuristic: $hs_r->{h_name}\n";
print "* Title:\t$hs_r->{h_header}\n";
print "* Summary:\t$hs_r->{h_summary}\n";
print "* SOLs:\t\t"; if (ref($hs_s) eq "ARRAY") {print join(", ", @{$hs_s})} else {print $hs_s}
print "\n\n";
}
exit 0;
}'
| perl -e '
my $xmldata;
while (<STDIN>) {
s/\r\n//g; s/\n//g; s/\r//g; s/\t/ /g;
if(m|http/1.. 200|gi) {$response=1} else {
if(m|http/1.. 30\d|gi) {print STDERR "Error: not authenticated.\n";exit 1}
if(m|http/1.. 404|gi) {print STDERR "Error: qkview ID not found.\n";exit 1}
}
if($response && m/<\?xml/gi) {$xml_response=1}
if($xml_response) {$xmldata .= $_}
}
eval {require XML::Simple};
if ($@) {print STDERR "Error: ihac-diagnostics requires perl module XML::Simple but it is not installed. Perl error: $@\n";exit 1}
eval {$xml = new XML::Simple->XMLin($xmldata)};
if ($@) {print STDERR "Error: Could not parse XML: $@\n";exit 1}
$hs_ver = $xml->{version}; $hs_sys = $xml->{system_information};
print "Hostname: $hs_sys->{hostname}\t Serial: $hs_sys->{bigip_chassis_serial_num}\n";
print "Version: $hs_ver->{version} $hs_ver->{edition}\t Platform: $hs_sys->{platform}\n\n";
$diag = $xml->{diagnostics}->{diagnostic};
foreach $hs ( sort { reverse($diag->{$a}->{run_data}->{h_importance}) cmp reverse($diag->{$b}->{run_data}->{h_importance}) } keys %{$diag} ) {
next if($diag->{$hs}->{run_data}->{match} eq "false");
$hs_r = $diag->{$hs}->{results}; $hs_s = $hs_r->{h_sols}->{solution};
print "* Severity: $diag->{$hs}->{run_data}->{h_importance} \tHeuristic: $hs_r->{h_name}\n";
print "* Title:\t$hs_r->{h_header}\n";
print "* Summary:\t$hs_r->{h_summary}\n";
print "* SOLs:\t\t"; if (ref($hs_s) eq "ARRAY") {print join(", ", @{$hs_s})} else {print $hs_s}
print "\n\n";
}
exit 0;
'
else
echoerr "Error: no qkview ID specified or not valid."
echoerr "Use: `basename $0` ID"
Expand Down
6 changes: 4 additions & 2 deletions ihac-fileget
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
#version: 1.1
#version: 2.0
#license: MIT
#author: Simon Kowallik <github simonkowallik.com>
#source: https://github.com/simonkowallik/iHAC
Expand All @@ -11,6 +11,8 @@ if [[ ! -z "$IHACPROXY" ]]; then IHACPROXY="x $IHACPROXY"; fi

function echoerr() { echo "$@" 1>&2; }

command -v curl >/dev/null 2>&1 || { echoerr "Error: $(basename $0) requires curl but it is not installed."; exit 1; }

if [[ -n "$1" ]] && [[ "$1" =~ ^[0-9]+$ ]] && [[ -n "$2" ]]
then
echo test | base64 -w0 > /dev/null 2>&1
Expand All @@ -20,7 +22,7 @@ then
else
fileid=`echo -n ${2#/} | base64 -b0`
fi
curl -s$IHACPROXY -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/1.0" \
curl -s$IHACPROXY -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/2.0" \
--cookie "$IHACAUTH" --cookie-jar "$IHACAUTH" \
-o - https://ihealth-api.f5.com/qkview-analyzer/api/qkviews/$1/files/${fileid//=/}
else
Expand Down
7 changes: 5 additions & 2 deletions ihac-filelist
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
#version: 1.2
#version: 2.0
#license: MIT
#author: Simon Kowallik <github simonkowallik.com>
#source: https://github.com/simonkowallik/iHAC
Expand All @@ -11,9 +11,12 @@ if [[ ! -z "$IHACPROXY" ]]; then IHACPROXY="x $IHACPROXY"; fi

function echoerr() { echo "$@" 1>&2; }

command -v perl >/dev/null 2>&1 || { echoerr "Error: $(basename $0) requires perl but it is not installed."; exit 1; }
command -v curl >/dev/null 2>&1 || { echoerr "Error: $(basename $0) requires curl but it is not installed."; exit 1; }

if [[ -n "$1" ]] && [[ "$1" =~ ^[0-9]+$ ]]
then
curl -si$IHACPROXY -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/1.0" \
curl -si$IHACPROXY -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/2.0" \
--cookie "$IHACAUTH" --cookie-jar "$IHACAUTH" \
-o - https://ihealth-api.f5.com/qkview-analyzer/api/qkviews/$1/files \
| perl -ne 's/\r\n//g;
Expand Down
7 changes: 5 additions & 2 deletions ihac-qkviewadd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
#version: 1.1
#version: 2.0
#license: MIT
#author: Simon Kowallik <github simonkowallik.com>
#source: https://github.com/simonkowallik/iHAC
Expand All @@ -11,6 +11,9 @@ if [[ ! -z "$IHACPROXY" ]]; then IHACPROXY="x $IHACPROXY"; fi

function echoerr() { echo "$@" 1>&2; }

command -v perl >/dev/null 2>&1 || { echoerr "Error: $(basename $0) requires perl but it is not installed."; exit 1; }
command -v curl >/dev/null 2>&1 || { echoerr "Error: $(basename $0) requires curl but it is not installed."; exit 1; }

if [[ "$#" -gt 0 ]]
then
QKVIEWS=("$@")
Expand All @@ -26,7 +29,7 @@ fi

for QKVIEW in "${QKVIEWS[@]}"; do
if [[ -f "$QKVIEW" ]] || [[ "$QKVIEW" == "-" ]]; then
curl --progress-bar -i$IHACPROXY -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/1.0" \
curl --progress-bar -i$IHACPROXY -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/2.0" \
--cookie "$IHACAUTH" --cookie-jar "$IHACAUTH" \
-F "qkview=@$QKVIEW" -F 'visible_in_gui=True' \
-o - https://ihealth-api.f5.com/qkview-analyzer/api/qkviews \
Expand Down
7 changes: 5 additions & 2 deletions ihac-qkviewdelete
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
#version: 1.1
#version: 2.0
#license: MIT
#author: Simon Kowallik <github simonkowallik.com>
#source: https://github.com/simonkowallik/iHAC
Expand All @@ -11,11 +11,14 @@ if [[ ! -z "$IHACPROXY" ]]; then IHACPROXY="x $IHACPROXY"; fi

function echoerr() { echo "$@" 1>&2; }

command -v perl >/dev/null 2>&1 || { echoerr "Error: $(basename $0) requires perl but it is not installed."; exit 1; }
command -v curl >/dev/null 2>&1 || { echoerr "Error: $(basename $0) requires curl but it is not installed."; exit 1; }

if [[ "$#" -gt 0 ]]
then
for QKVIEWID in "$@"; do
if [[ -n "$QKVIEWID" ]] && [[ "$QKVIEWID" =~ ^[0-9]+$ ]]; then
curl -si$IHACPROXY -X DELETE -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/1.0" \
curl -si$IHACPROXY -X DELETE -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/2.0" \
--cookie "$IHACAUTH" --cookie-jar "$IHACAUTH" \
-o - https://ihealth-api.f5.com/qkview-analyzer/api/qkviews/$QKVIEWID \
| perl -ne 's/\r\n//g;
Expand Down
8 changes: 5 additions & 3 deletions ihac-qkviewget
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
#version: 1.1
#version: 2.0
#license: MIT
#author: Simon Kowallik <github simonkowallik.com>
#source: https://github.com/simonkowallik/iHAC
Expand All @@ -11,18 +11,20 @@ if [[ ! -z "$IHACPROXY" ]]; then IHACPROXY="-x $IHACPROXY"; fi

function echoerr() { echo "$@" 1>&2; }

command -v curl >/dev/null 2>&1 || { echoerr "Error: $(basename $0) requires curl but it is not installed."; exit 1; }

if [[ -n "$1" ]] && [[ "$1" =~ ^[0-9]+$ ]]
then
if [[ -n "$2" ]]
then
curl $IHACPROXY --progress-bar -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/1.0" \
curl $IHACPROXY --progress-bar -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/2.0" \
--cookie "$IHACAUTH" --cookie-jar "$IHACAUTH" \
-o - https://ihealth-api.f5.com/qkview-analyzer/api/qkviews/$1/files/qkview \
> $2
if [[ $? -eq 0 ]]; then echo "OK"; fi
elif [[ ! -t 1 ]]
then
curl $IHACPROXY --progress-bar -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/1.0" \
curl $IHACPROXY --progress-bar -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/2.0" \
--cookie "$IHACAUTH" --cookie-jar "$IHACAUTH" \
-o - https://ihealth-api.f5.com/qkview-analyzer/api/qkviews/$1/files/qkview
else
Expand Down
35 changes: 19 additions & 16 deletions ihac-qkviewlist
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
#version: 1.2
#version: 2.0
#license: MIT
#author: Simon Kowallik <github simonkowallik.com>
#source: https://github.com/simonkowallik/iHAC
Expand All @@ -11,7 +11,10 @@ if [[ ! -z "$IHACPROXY" ]]; then IHACPROXY="x $IHACPROXY"; fi

function echoerr() { echo "$@" 1>&2; }

for id in `curl -si$IHACPROXY -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/1.0" \
command -v perl >/dev/null 2>&1 || { echoerr "Error: $(basename $0) requires perl but it is not installed."; exit 1; }
command -v curl >/dev/null 2>&1 || { echoerr "Error: $(basename $0) requires curl but it is not installed."; exit 1; }

for id in `curl -si$IHACPROXY -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/2.0" \
--cookie "$IHACAUTH" --cookie-jar "$IHACAUTH" \
-o - https://ihealth-api.f5.com/qkview-analyzer/api/qkviews \
| perl -ne 's/\r\n//g;
Expand All @@ -22,23 +25,23 @@ for id in `curl -si$IHACPROXY -H"Accept: application/vnd.f5.ihealth.api.v1.0" --
do
if [[ "$id" == "ERR" ]]; then exit 1; fi
if [[ ! "$id" =~ ^[0-9]+$ ]]; then echoerr "Error: $id is not a valid qkview ID."; exit 1; fi
URLS="$URLS https://ihealth-api.f5.com/qkview-analyzer/api/qkviews/$id/bigip/system/hostname https://ihealth-api.f5.com/qkview-analyzer/api/qkviews/$id"
URLS="$URLS https://ihealth-api.f5.com/qkview-analyzer/api/qkviews/$id"
done
if [[ -z "$URLS" ]]; then echoerr "Error: no qkview IDs recevied."; exit 1; fi

curl -si$IHACPROXY -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/1.0" \
curl -si$IHACPROXY -H"Accept: application/vnd.f5.ihealth.api.v1.0" --user-agent "iHAC/2.0" \
--cookie "$IHACAUTH" --cookie-jar "$IHACAUTH" \
-o - \
$URLS \
| perl -ne 's/\r\n//g;
if(m|http/1.. 30\d|gi) {print STDERR "Error: not authenticated.\n";exit 1}
if(m|http/1.. (40\d)|gi) {print STDERR "Error: received $1 from server.\n";exit 1}
if(m|<hostname>(.*)</hostname>|gi) {$hostname=$1}
if(m|<chassis_serial>(.*)</chassis_serial>|gi) {$serial=$1}
if(m|<f5_support_case>(.*)</f5_support_case>|gi) {$case=$1}
if(m|<date>(.*)</date>|gi) {$date=$1}
if(m|<bigip>.*/(\d+)/.*</bigip>|gi) {$id=$1}
if (defined($hostname) && defined($serial) && defined($case) && defined($date) && defined($id)) {
printf "%d %-30s %-31s %-12s %s\n", $id, $hostname, $serial, $date, $case;
undef $id, $hostname, $serial, $date, $case;
}'
| perl -ne 's/\r\n//g;
if(m|http/1.. 30\d|gi) {print STDERR "Error: not authenticated.\n";exit 1}
if(m|http/1.. (40\d)|gi) {print STDERR "Error: received $1 from server.\n";exit 1}
if(m|<chassis_serial>(.*)</chassis_serial>|gi) {$serial=$1}
if(m|<hostname>(.*)</hostname>|gi) {$hostname=$1}
if(m|<f5_support_case>(.*)</f5_support_case>|gi) {$case=$1}
if(m|<date>(.*)000</date>|gi) {$date=$1}
if(m|<bigip>.*/(\d+)/.*</bigip>|gi) {$id=$1}
if ( defined($id)) {
printf "%d %-30s %-31s %-12s %s\n", $id, $hostname, $serial, scalar localtime($date), $case;
undef $id, $hostname, $serial, $date, $case;
}'

0 comments on commit 281db38

Please sign in to comment.