Last active
          September 27, 2020 17:36 
        
      - 
      
- 
        Save schneefisch/c07463240d02c9df83037fbda3133f5c to your computer and use it in GitHub Desktop. 
    search source IPs and occurrences from Apache access_log
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # us awk to show the unique source-ips from access logs | |
| awk '{ print $1 }' /var/log/*access*log | sort -n | uniq -c | sort -nr | head -20 | |
| # to use that on several compressed files: | |
| gzip -dc /var/log/*access*.gz | awk '{ print $1 }' | sort -n | uniq -c | sort -nr | |
| # to show only the most-occuring addresses: | |
| gzip -dc /var/log/*access*.gz | awk '{ print $1 }' | sort -n | uniq -c | sort -nr | head -20 | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment