From 73431c12d631d6015d7c19d4f6753441221bc03b Mon Sep 17 00:00:00 2001 From: Hui Li Date: Mon, 16 Nov 2020 12:39:09 +0800 Subject: [PATCH] [TD-1751]add script for geting client ip add and new connection time from taosdlog file --- packaging/tools/get_client.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 packaging/tools/get_client.sh diff --git a/packaging/tools/get_client.sh b/packaging/tools/get_client.sh new file mode 100755 index 0000000000..0d34ecb311 --- /dev/null +++ b/packaging/tools/get_client.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# + +log_dir=$1 +result_file=$2 + +if [ ! -n "$1" ];then + echo "Pleas input the director of taosdlog." + echo "usage: ./get_client.sh " + exit 1 +else + log_dir=$1 +fi + +if [ ! -n "$2" ];then + result_file=clientInfo.txt +else + result_file=$2 +fi + +grep "new TCP connection" ${log_dir}/taosdlog.* | sed -e "s/0x.* from / /"|sed -e "s/,.*$//"|sed -e "s/:[0-9]*$//"|sort -r|uniq -f 2|sort -k 3 -r|uniq -f 2 > ${result_file} -- GitLab