File: acc.pl

package info (click to toggle)
gatling 0.13-6
  • links: PTS
  • area: main
  • in suites: sid, stretch
  • size: 1,196 kB
  • ctags: 1,115
  • sloc: ansic: 23,805; makefile: 143; sh: 71; perl: 30
file content (25 lines) | stat: -rw-r--r-- 542 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl
while (<>) {
  chomp;
  my @x=split(" ");
  if ($x[0] =~ m/^\d{4}-\d\d-\d\d$/) {
    my $tmp = "$x[0]|$x[1]";
    shift @x;
    $x[0]=$tmp;
  }
  if ($x[1] =~ /^(GET|POST|HEAD)/) {
    if ($x[1] =~ /SSL/) {
      $x[3] = "https://" . $x[7] . $x[3];
    } else {
      $x[3] = "http://" . $x[7] . $x[3];
    }
  }
  if ($x[1] eq "accept") {
    $ip{$x[2]} = $x[3];
  } elsif ($#x == 7) {
    $x[2] = $ip{$x[2]};
    $x[2] = "0.0.0.0" if ($x[2] eq "");
    next if ($x[2] eq "82.146.42.231");
    print join(" ",@x),"\n";
  }
}