Skip to content

Instantly share code, notes, and snippets.

@spot62
Created June 1, 2023 06:14
Show Gist options
  • Save spot62/387de09819ab937b9401a877fdf1b583 to your computer and use it in GitHub Desktop.
Save spot62/387de09819ab937b9401a877fdf1b583 to your computer and use it in GitHub Desktop.
esb_requests_log_stat.sh
#!/bin/bash
ESB_REQUESTS_LOG_PATH="/opt/esb/Runtime_ESBSE/container/log/*.request.log"
#HOSTS=(`cat ./requests/*.request.log | awk '{print $1}' | sort -n | uniq -c`)
#HOSTS=(`cat ./requests/2019_12_04.request.log | awk '{print $1}' | sort -n | uniq -c`)
# cat ${ESB_REQUESTS_LOG_PATH} | awk '$4 >= "25/May/2020:00:00:00"' | awk '{print $1}' | sort -n | uniq -c
HOSTS=(`cat ${ESB_REQUESTS_LOG_PATH} | awk '$4 >= "1/May/2023:00:00:00"' | awk '{print $1}' | sort -n | uniq -c`)
echo "${HOSTS}"
for ((i=0;i< ${#HOSTS[@]} ;i+=2))
do
name=`dig -x ${HOSTS[$i+1]} +short`
echo -e "${HOSTS[$i]}\t${HOSTS[$i+1]}\t${name}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment