从 DuckDB 读取和剖析 PCAP 文件
维护者: hyehudai
安装和加载
INSTALL wireduck FROM community;
LOAD wireduck;
示例
-- Basic PCAP reader for local files.
D select count(*) , sum ("tcp.len") , "tcp.srcport" ,"tcp.dstport" from read_pcap('~/wireduck/fix.pcap', protocols:=['ip','tcp'],climit:=100) group by "tcp.srcport" ,"tcp.dstport" ;;
┌──────────────┬────────────────┬─────────────┬─────────────┐
│ count_star() │ sum("tcp.len") │ tcp.srcport │ tcp.dstport │
│ int64 │ int128 │ int64 │ int64 │
├──────────────┼────────────────┼─────────────┼─────────────┤
│ 429 │ 259678 │ 11001 │ 53867 │
│ 56 │ 19702 │ 53867 │ 11001 │
└──────────────┴────────────────┴─────────────┴─────────────┘
关于 wireduck
pcap 文件分析扩展
Wireduck 在后台运行 tshark,利用 Wireshark 的词汇表来解析任何受支持协议的任何数据包到其字段。 从而实现网络数据分析和分析。
功能
- read_pcap 表函数。
- 支持 Wireshark 支持的任何协议。
- 允许使用 cfilter climit 参数将下推过滤器推送到 Wireshark
先决条件
应安装 tshark(作为 Wireshark 的一部分安装)。 通过以下方式验证其存在:
tshark --version
有关示例和说明,请查看 Readme
注意:Wireduck 仍处于实验阶段。