query
-
mysql tcp 모니터링 코드Linux 2017. 11. 8. 14:14
루트권한 필요.#!/bin/bash tcpdump -i eth0 -s 0 -l -w - dst port 3306 | strings | perl -e 'while() { chomp; next if /^[^ ]+[ ]*$/; if(/^(SELECT|UPDATE|DELETE|INSERT|SET|COMMIT|ROLLBACK|CREATE|DROP|ALTER|CALL)/i) { if (defined $q) { print "$q\n"; } $q=$_; } else { $_ =~ s/^[ \t]+//; $q.=" $_"; }}'