Hi,all:
I use packetbeat
to analyse pcap file for redis protocol. The command i use is
./packetbeat -c ./packetbeat.yml -e -I redis_xg-bjdev-rediscluster-2_prot-7101_20161222110723_20161222110733.pcap -E packetbeat.protocols.redis.ports=7101 -t
and then, i will get something like this
2017/01/16 08:09:03.759058 beat.go:182: INFO Setup Beat: packetbeat; Version: 6.0.0-alpha1
2017/01/16 08:09:03.759514 file.go:54: INFO File output path set to: ./logs
2017/01/16 08:09:03.759942 file.go:55: INFO File output base filename set to: packetbeat
2017/01/16 08:09:03.760467 file.go:58: INFO Rotate every bytes set to: 10240000
2017/01/16 08:09:03.761045 file.go:62: INFO Number of files set to: 7
2017/01/16 08:09:03.761626 outputs.go:108: INFO Activated file as output plugin.
2017/01/16 08:09:03.762141 publish.go:295: INFO Publisher name: vagrant-ubuntu-trusty
2017/01/16 08:09:03.762712 async.go:63: INFO Flush Interval set to: -1s
2017/01/16 08:09:03.763242 async.go:64: INFO Max Bulk Size set to: -1
2017/01/16 08:09:03.763917 procs.go:79: INFO Process matching disabled
2017/01/16 08:09:03.764557 protos.go:89: INFO registered protocol plugin: memcache
2017/01/16 08:09:03.765030 protos.go:89: INFO registered protocol plugin: mysql
2017/01/16 08:09:03.765582 protos.go:89: INFO registered protocol plugin: nfs
2017/01/16 08:09:03.766002 protos.go:89: INFO registered protocol plugin: pgsql
2017/01/16 08:09:03.766519 protos.go:89: INFO registered protocol plugin: thrift
2017/01/16 08:09:03.767142 protos.go:89: INFO registered protocol plugin: amqp
2017/01/16 08:09:03.767680 protos.go:89: INFO registered protocol plugin: dns
2017/01/16 08:09:03.768176 protos.go:89: INFO registered protocol plugin: http
2017/01/16 08:09:03.768594 protos.go:89: INFO registered protocol plugin: mongodb
2017/01/16 08:09:03.769073 protos.go:89: INFO registered protocol plugin: redis
2017/01/16 08:09:03.769667 protos.go:89: INFO registered protocol plugin: cassandra
2017/01/16 08:09:03.770873 beat.go:212: INFO packetbeat start running.
2017/01/16 08:09:03.788220 logp.go:245: INFO Metrics logging every 30s
2017/01/16 08:09:05.615160 sniffer.go:384: INFO Input finish. Processed 72257 packets. Have a nice day!
2017/01/16 08:09:05.616699 util.go:48: INFO flows worker loop stopped
2017/01/16 08:09:05.617133 logp.go:271: INFO Total non-zero values: libbeat.publisher.published_events=12880 redis.unmatched_responses=23 tcp.dropped_because_of_gaps=4
2017/01/16 08:09:05.619232 logp.go:272: INFO Uptime: 1.978363811s
2017/01/16 08:09:05.619735 beat.go:216: INFO packetbeat stopped.
root@vagrant-ubuntu-trusty:/go/src/github.com/elastic/beats/packetbeat#
the problem is : every time i run the command above, i find the output value of "libbeat.publisher.published_events" is different.
here is three test sample:
root@vagrant-ubuntu-trusty:/go/src/github.com/elastic/beats/packetbeat# ./packetbeat -c ./packetbeat.yml -e -I redis_xg-bjdev-rediscluster-2_prot-7101_20161222110723_20161222110733.pcap -E packetbeat.protocols.redis.ports=7101 -t
...
2017/01/16 08:25:21.078071 logp.go:271: INFO Total non-zero values: tcp.dropped_because_of_gaps=4 redis.unmatched_responses=23 libbeat.publisher.published_events=12071
...
root@vagrant-ubuntu-trusty:/go/src/github.com/elastic/beats/packetbeat# ./packetbeat -c ./packetbeat.yml -e -I redis_xg-bjdev-rediscluster-2_prot-7101_20161222110723_20161222110733.pcap -E packetbeat.protocols.redis.ports=7101 -t
...
2017/01/16 08:25:24.575450 logp.go:271: INFO Total non-zero values: libbeat.publisher.published_events=13601 redis.unmatched_responses=23 tcp.dropped_because_of_gaps=4
...
root@vagrant-ubuntu-trusty:/go/src/github.com/elastic/beats/packetbeat# ./packetbeat -c ./packetbeat.yml -e -I redis_xg-bjdev-rediscluster-2_prot-7101_20161222110723_20161222110733.pcap -E packetbeat.protocols.redis.ports=7101 -t
...
2017/01/16 08:25:29.346508 logp.go:271: INFO Total non-zero values: libbeat.publisher.published_events=10775 redis.unmatched_responses=23 tcp.dropped_because_of_gaps=4
...
root@vagrant-ubuntu-trusty:/go/src/github.com/elastic/beats/packetbeat#
as shown above, i get 12071, 13601 and 10775 respectively.
I can't figure out the reason behind this yet, but I'm still working on it.
so, can someone explain why this happens, and what I can do.
thanks a lot!
FYI, my packetbeat.yml
as follow:
packetbeat.interfaces.device: any
packetbeat.flows:
timeout: 30s
period: 10s
#========================== Transaction protocols =============================
packetbeat.protocols.icmp:
enabled: true
packetbeat.protocols.amqp:
ports: [5672]
packetbeat.protocols.cassandra:
ports: [9042]
packetbeat.protocols.dns:
ports: [53]
include_authorities: true
include_additionals: true
packetbeat.protocols.http:
ports: [80, 8080, 8000, 5000, 8002]
packetbeat.protocols.memcache:
ports: [11211]
packetbeat.protocols.mysql:
ports: [3306]
packetbeat.protocols.pgsql:
ports: [5432]
packetbeat.protocols.redis:
ports: [6379]
packetbeat.protocols.thrift:
ports: [9090]
packetbeat.protocols.mongodb:
ports: [27017]
packetbeat.protocols.nfs:
ports: [2049]
#------------------------------- File output -----------------------------------
output.file:
enabled: true
path: "./logs"
filename: packetbeat
rotate_every_kb: 10000
number_of_files: 7