Filter log file entries based on date range

前端 未结 3 526
刺人心
刺人心 2020-11-22 07:32

My server is having unusually high CPU usage, and I can see Apache is using way too much memory. I have a feeling, I\'m being DOS\'d by a single IP - maybe you can help me f

3条回答
  •  眼角桃花
    2020-11-22 07:35

    If someone encounters with the awk: invalid -v option, here's a script to get the most active IPs in a predefined time range:

    cat  | awk '$4 >= "[04/Jul/2017:07:00:00" && $4 < "[04/Jul/2017:08:00:00"' | awk '{print $1}' | sort -n | uniq -c | sort -nr | head -20
    

提交回复
热议问题