drop.awk

来自「跑leach需要的」· AWK 代码 · 共 27 行

AWK
27
字号
BEGIN {	fsDrops = 0;	otherDrops = 0;}($2 >= startTime && $2 <= endTime) {	op = $1;	time = $2;	src = $9;	dst = $10;	if (match(src,"^0\.") && $1 == "+") {		numFs++;	}	if (numFs > 0 && op == "d") {		if (match(src,"^0\."))			fsDrops++;		else			otherDrops++;	}	if (match(src,"^0\.") && ($1 == "-" || $1 == "d"))		numFs--;}END {	print otherDrops, fsDrops;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?