MaatKit版 query-digest です。
version: '3.9'
services:
mk-query-digest:
image: hoshihaya/mk-query-digest
volumes:
- type: bind
source: ./tcpdump
target: /root/tcpdump/
mkdir tcpdump
file_prefix=$(hostname)-$(date +%Y%m%d%H%M)
## -G5 で 5秒パケットを取得
sudo tcpdump -i eth0:$(hostname) port 3306 -np -s 65535 -W1 -G5 -w ./tcpdump/${file_prefix}.db.pcap
sudo tcpdump -s 65535 -x -nn -q -tttt -l -r ./tcpdump/${file_prefix}.db.pcap > ./tcpdump/${file_prefix}.db.pcap.log
## 解析
docker compose run --rm mk-query-digest --type tcpdump --filter '$event->{fingerprint} !~ m/^(commit|admin|set)/' --limit 50 ./tcpdump/${file_prefix}.db.pcap.log
mkdir tcpdump
file_prefix=$(hostname)-$(date +%Y%m%d%H%M)
## -G5 で 5秒パケットを取得
sudo tcpdump -i eth0:$(hostname) port 11211 -np -s 65535 -W1 -G5 -w ./tcpdump/${file_prefix}.memd.pcap
sudo tcpdump -s 65535 -x -nn -q -tttt -l -r ./tcpdump/${file_prefix}.memd.pcap > ./tcpdump/${file_prefix}.memd.pcap.log
## 解析
docker compose run --rm mk-query-digest --type memcached tcpdump/${file_prefix}.memd.pcap.log
Content type
Image
Digest
sha256:371ece2f7…
Size
98.4 MB
Last updated
almost 3 years ago
docker pull hoshihaya/mk-query-digest