# 统计某个apk下载数量,IP去重
grep "/package/Condut_240619.apk" /usr/local/nginx/logs/apk.cashbaza.log | awk '{print $1}' | sort | uniq | wc -l
# 只统计状态码为200的
grep "/package/euhilh240616.apk" /usr/local/nginx/logs/apk.cashbaza.log | awk '$9 == 200 {print $1}' | sort | uniq | wc -l
# 统计某个时间段的,比如 19/Jun 这一天的
awk '$4 >= "[19/Jun/2024:00:00:00" && $4 <= "[20/Jun/2024:00:00:00"' /usr/local/nginx/logs/apk.cashbaza.log | grep "/package/euhilh240616.apk" | awk '{print $1}' | sort | uniq | wc -l
# 统计某个时间段到目前为止的
current_time=$(LC_TIME=C date +"[%d/%b/%Y:%H:%M:%S")
awk -v start="[21/Jun/2024:00:00:00" -v end="$current_time]" '$4 >= start && $4 <= end' /usr/local/nginx/logs/apk.cashbaza.log | grep "/package/euhilh240616.apk" | awk '{print $1}' | sort | uniq | wc -l
# 判断哪个渠道来的量
awk '$4 >= "[05/Jul/2024:00:00:00" && $4 <= "[05/Jul/2024:16:16:00"' /usr/local/nginx/logs/apk.cashbaza.log | grep "/package/wealthy240701.apk" | awk '{print $11}' | sort | uniq