Leser: 1
4 Einträge, 1 Seite |
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
Mi 23. Mar 07:17:39 CEST 2008
qdisc htb 1: r2q 1 default 0 direct_packets_stat 416 ver 3.17
Sent 69203 bytes 416 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 1111: parent 1:111 limit 128p quantum 1514b flows 128/1024 perturb 10sec
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 1112: parent 1:112 limit 128p quantum 1514b flows 128/1024 perturb 10sec
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 1123: parent 1:123 limit 128p quantum 1514b flows 128/1024 perturb 10sec
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 1124: parent 1:124 limit 128p quantum 1514b flows 128/1024 perturb 10sec
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 1125: parent 1:125 limit 128p quantum 1514b flows 128/1024 perturb 10sec
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 1131: parent 1:131 limit 128p quantum 1514b flows 128/1024 perturb 10sec
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 1132: parent 1:132 limit 128p quantum 1514b flows 128/1024 perturb 10sec
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
class htb 1:132 parent 1:13 leaf 1132: prio 0 quantum 12500 rate 100000bit ceil 500000bit burst 1611b/8 mpu 0b overhead 0b cburst 1661b/8 mpu 0b overhead 0b level 0
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 0 borrowed: 0 giants: 0
tokens: 128960 ctokens: 26592
class htb 1:123 parent 1:12 leaf 1123: prio 0 quantum 12500 rate 100000bit ceil 1500Kbit burst 1611b/8 mpu 0b overhead 0b cburst 1786b/8 mpu 0b overhead 0b level 0
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 0 borrowed: 0 giants: 0
tokens: 128960 ctokens: 9530
class htb 1:11 parent 1:1 rate 400000bit ceil 2048Kbit burst 1649b/8 mpu 0b overhead 0b cburst 1855b/8 mpu 0b overhead 0b level 6
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 0 borrowed: 0 giants: 0
tokens: 33000 ctokens: 7250
(qdisc\s\w*\s\w+\S\d*|class\s\S*\s\w+\S\d*)\s+.*\s*(Sent\s\d+).*(dropped\s\d+).*(overlimits\s\d+)(\S|\S*.*\s*.*)
1
2
3
4
5
6
7
8
9
10
11
12
13
my $file_to_read = "./stats.log";
open(my $in, "< $file_to_read") or die "Can't open file";
while(<$in>)
{
#print <$in>;
#print "\n\n";
if(<$in> =~ /(qdisc\s\w*\s\w+\S\d*|class\s\S*\s\w+\S\d*)\s+.*\s*(Sent\s\d+).*(dropped\s\d+).*(overlimits\s\d+)(\S|\S*.*\s*.*)/ )
{
print "$1 $2 $3 $4\n";
}
}
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
#!/usr/bin/perl use strict; use warnings; my $content = do{ local $/; <DATA> }; while( $content =~ m/(qdisc\s\w*\s\w+\S\d*|class\s\S*\s\w+\S\d*)\s+.*\s*(Sent\s\d+).*(dropped\s\d+).*(overlimits\s\d+)(\S|\S*.*\s*.*)/g ){ print "$1 $2 $3 $4\n"; } __DATA__ Mi 23. Mar 07:17:39 CEST 2008 qdisc htb 1: r2q 1 default 0 direct_packets_stat 416 ver 3.17 Sent 69203 bytes 416 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 qdisc sfq 1111: parent 1:111 limit 128p quantum 1514b flows 128/1024 perturb 10sec Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 qdisc sfq 1112: parent 1:112 limit 128p quantum 1514b flows 128/1024 perturb 10sec Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 qdisc sfq 1123: parent 1:123 limit 128p quantum 1514b flows 128/1024 perturb 10sec Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 qdisc sfq 1124: parent 1:124 limit 128p quantum 1514b flows 128/1024 perturb 10sec Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 qdisc sfq 1125: parent 1:125 limit 128p quantum 1514b flows 128/1024 perturb 10sec Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 qdisc sfq 1131: parent 1:131 limit 128p quantum 1514b flows 128/1024 perturb 10sec Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 qdisc sfq 1132: parent 1:132 limit 128p quantum 1514b flows 128/1024 perturb 10sec Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 class htb 1:132 parent 1:13 leaf 1132: prio 0 quantum 12500 rate 100000bit ceil 500000bit burst 1611b/8 mpu 0b overhead 0b cburst 1661b/8 mpu 0b overhead 0b level 0 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 lended: 0 borrowed: 0 giants: 0 tokens: 128960 ctokens: 26592 class htb 1:123 parent 1:12 leaf 1123: prio 0 quantum 12500 rate 100000bit ceil 1500Kbit burst 1611b/8 mpu 0b overhead 0b cburst 1786b/8 mpu 0b overhead 0b level 0 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 lended: 0 borrowed: 0 giants: 0 tokens: 128960 ctokens: 9530 class htb 1:11 parent 1:1 rate 400000bit ceil 2048Kbit burst 1649b/8 mpu 0b overhead 0b cburst 1855b/8 mpu 0b overhead 0b level 6 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 lended: 0 borrowed: 0 giants: 0 tokens: 33000 ctokens: 7250
1
2
3
4
5
6
7
8
9
10
11
12
C:\>perl regex.pl
qdisc htb 1: Sent 69203 dropped 0 overlimits 0
qdisc sfq 1111: Sent 0 dropped 0 overlimits 0
qdisc sfq 1112: Sent 0 dropped 0 overlimits 0
qdisc sfq 1123: Sent 0 dropped 0 overlimits 0
qdisc sfq 1124: Sent 0 dropped 0 overlimits 0
qdisc sfq 1125: Sent 0 dropped 0 overlimits 0
qdisc sfq 1131: Sent 0 dropped 0 overlimits 0
qdisc sfq 1132: Sent 0 dropped 0 overlimits 0
class htb 1:132 Sent 0 dropped 0 overlimits 0
class htb 1:123 Sent 0 dropped 0 overlimits 0
class htb 1:11 Sent 0 dropped 0 overlimits 0
open( DATA , "< $file_to_read") or die "Can't open file";
deepc+2008-05-23 11:40:15--Super, es funktioniert
Anscheinend hatte ich auch noch ein Problem beim File einlesen.
Das klappt aber jetzt auch über
Code: (dl )open( DATA , "< $file_to_read") or die "Can't open file";
Vielen Dank!
4 Einträge, 1 Seite |