#!/usr/bin/perl use strict; use warnings; my $content = do{ local $/; }; 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