tcpflow实际上也是一个抓包工具,这个抓包工具与tcpdump不同的是它是以流为单位显示数据内容,而tcpdump以包为单位显示数据。
我们平常会经常分析HTTP数据,用tcpflow会更便捷
具体学习大家可以man tcpflow下,网上有免费下载tcpflow软件的
http://www.circlemud.org/~jelson/software/tcpflow/
举例:
在一台负载均衡器上分析其分配状况
在负载均衡服务器上tcpflow -cp host 1.1.1.1(后端 IP)
看缓存有没有命中,那么可以在缓存服务器上tcpflow -cp host 1.1.1.1(源端IP)|grep /index.html (url的相对路径) -A 10
可以根据自己需要自己去定义过滤,用法与tcpdump类似。
tcpflow version 0.21 by Jeremy Elson < jelson@circlemud.org >
usage: tcpflow [-chpsv] [-b max_bytes] [-d debug_level] [-f max_fds]
[-i iface] [-w file] [expression]
-b: max number of bytes per flow to save
-c: console print only (don't create files)
-d: debug level; default is 1
-f: maximum number of file descriptors to use
-h: print this help message
-i: network interface on which to listen
(type "ifconfig -a" for a list of interfaces)
-p: don't use promiscuous mode
-r: read packets from tcpdump output file
-s: strip non-printable characters (change to '.')
-v: verbose operation equivalent to -d 10
expression: tcpdump-like filtering expression
See the man page for additional information.
我们平常会经常分析HTTP数据,用tcpflow会更便捷
具体学习大家可以man tcpflow下,网上有免费下载tcpflow软件的
http://www.circlemud.org/~jelson/software/tcpflow/
举例:
在一台负载均衡器上分析其分配状况
在负载均衡服务器上tcpflow -cp host 1.1.1.1(后端 IP)
看缓存有没有命中,那么可以在缓存服务器上tcpflow -cp host 1.1.1.1(源端IP)|grep /index.html (url的相对路径) -A 10
可以根据自己需要自己去定义过滤,用法与tcpdump类似。
tcpflow version 0.21 by Jeremy Elson < jelson@circlemud.org >
usage: tcpflow [-chpsv] [-b max_bytes] [-d debug_level] [-f max_fds]
[-i iface] [-w file] [expression]
-b: max number of bytes per flow to save
-c: console print only (don't create files)
-d: debug level; default is 1
-f: maximum number of file descriptors to use
-h: print this help message
-i: network interface on which to listen
(type "ifconfig -a" for a list of interfaces)
-p: don't use promiscuous mode
-r: read packets from tcpdump output file
-s: strip non-printable characters (change to '.')
-v: verbose operation equivalent to -d 10
expression: tcpdump-like filtering expression
See the man page for additional information.