示例:对所有 FTP 流量进行采样
以下配置在特定 T3 接口的输出路径中收集有关使用 FTP 的中等百分比数据包的统计信息,并在名为 t3-ftp-traffic.txt 的文件中收集这些信息。
创建筛选器:
[edit firewall family inet] filter ftp-stats { term ftp-usage { from { destination-port [ftp ftp-data]; } then { sample; accept; } } }
将过滤器应用于 T3 接口:
[edit interfaces] t3-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 t3-ftp-traffic.txt; files 50; size 1m; } } } }