示例:对所有 FTP 流量进行采样
以下配置收集有关在特定以太网接口的输出路径中使用 FTP 的中等百分比的数据包的统计信息,并将信息收集到名为 et-ftp-traffic.txt 的文件中。
创建筛选条件:
[edit firewall family inet]
filter ftp-stats {
term ftp-usage {
from {
destination-port [ftp ftp-data];
}
then {
sample;
accept;
}
}
}
将过滤器应用于接口:
[edit interfaces]
et-7/0/2 {
unit 0 {
family inet {
filter {
input ftp-stats;
}
address 10.35.78.254/32 {
destination 10.35.78.4;
}
}
}
}
最后,收集 10% 候选样本的统计数据:
[edit forwarding-options]
sampling {
input {
rate 10;
}
family inet {
output {
file {
filename et-ftp-traffic.txt;
files 50;
size 1m;
}
}
}
}