-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfix_app_names.pl
executable file
·104 lines (99 loc) · 2.64 KB
/
fix_app_names.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/usr/bin/perl
use strict;
use warnings;
my @files = qw(
tx-websvc01.csv
tx-websvc02.csv
tx-websvc03.csv
tx-websvc04.csv
tx-websvc05.csv
);
my %app_names = (
asaws => 'AdesaSmartAuction',
AIWS => 'Attachment',
AUCTION => 'AuctionInfo',
airws => 'AuctionInventoryRegistration',
aws => 'Authentication',
blobws => 'BlobServer',
CarProof => 'CarProof',
chargesws => 'Charges',
cws => 'Credit',
DentWizard => 'DentWizardMobileSynchronization',
ecrdataws => 'ECRData',
ecrdws => 'ECRDisplay',
ecrpricews => 'ECRPrice',
ecrvehws => 'ECRVeh',
ecrws => 'ECR',
feesws => 'Fees',
ICS => 'InSightComplianceService',
isws => 'InventorySearch',
kws => 'Kiosk',
LSJL => 'LaneserverJMXListener',
mtws => 'MMRTransactions',
pbcws => 'PriceBookCanada',
pbws => 'PriceBook',
pvws => 'PurchasedVehicles',
rlnws => 'RemoteListingNotification',
sws => 'SalvageInfo',
spws => 'SpecialPricing',
webservices => 'TRACrawler',
tws => 'Transaction',
uccw => 'UserChangeCrawlerWeb',
uws => 'User',
vdws => 'VehicleDecoder',
vdbuws => 'VINDecoderBulkUpdate',
VID => 'VinStyleIDtoMID',
INSP => 'InspectionSolutions'
);
for my $file (@files) {
open F, $file or die "Couldn't open $file for reading: $!\n";
my $outfile = $file . ".new";
open O, "> $outfile" or die "Couldn't open $outfile for writing: $!\n";
while (<F>) {
for my $match (keys %app_names) {
if ( $_ =~ /,$match.*?,/ ) {
$_ =~ s/,$match.*?,/,$app_names{$match},/;
print O $_;
last;
}
elsif ( $_ =~ /,ecrpricews-PROD-tx-websvc04-2,/ ) {
$_ =~ s/,ecrpricews-PROD-tx-websvc04-2,/,ECRPrice\/2,/;
print O $_;
last;
}
elsif ( $_ =~ /,ecrvehws-PROD-tx-websvc05-2,/ ) {
# This is a stupid hack
# They have two instances running in the same directory
# Luckily, the PID remained consistent for the duration
if ( $_ =~ /,17297,/ ) {
$_ =~ s/,ecrvehws-PROD-tx-websvc05-2,/,ECRVeh\/2,/;
print O $_;
last;
}
elsif ( $_ =~ /,18556,/ ) {
$_ =~ s/,ecrvehws-PROD-tx-websvc05-2,/,ECRVeh\/3,/;
print O $_;
last;
}
}
elsif ( $_ =~ /,15206,LSJL-PROD-tx-websvc04-1,/ ) {
# This is a stupid hack
# I didn't capture one appname correctly, so it's named
# the same as another app
# Luckily, the PID remained consistent for the duration
$_ =~ s/,LSJL-PROD-tx-websvc04-1,/,MAFS,/;
print O $_;
}
elsif ( $_ =~ /,7174,webservices\.manheim\.com,/ ) {
# This is a stupid hack
# I didn't capture one appname correctly, so it's named
# the same as another app
# Luckily, the PID remained consistent for the duration
$_ =~ s/,webservices\.manheim\.com,/,MAFS,/;
print O $_;
}
}
}
close O;
close F;
}