Last active
December 27, 2017 12:59
-
-
Save hermes-pimentel/4d28e0764ff94af46c6e64a3b91e0762 to your computer and use it in GitHub Desktop.
ELB/CF Parser
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
| #download files from bucket | |
| #group logs | |
| cat *.log >> single.txt && mv single.txt single.log | |
| #IPS GET | |
| cat single.log| grep -v POST | awk '{print $3}' | cut -d : -f 1 | sort | uniq -c | sort -nr | |
| #IPS POST | |
| cat single.log| grep -v GET | awk '{print $3}' | cut -d : -f 1 | sort | uniq -c | sort -nr | |
| #both | |
| cat single.log | awk '{print $3}' | cut -d : -f 1 | sort | uniq -c | sort -nr | |
| ##### cloud frontlogs ##### | |
| #10+ GET | |
| cat cloudfront.txt | grep -v POST | awk '{print $5}' | cut -d : -f 1 | sort | uniq -c | sort -nr | head -10 | |
| #10+ POST | |
| cat cloudfront.txt | grep -v GET | awk '{print $5}' | cut -d : -f 1 | sort | uniq -c | sort -nr | head -10 | |
| #10+ all | |
| cat cloudfront.txt | awk '{print $5}' | cut -d : -f 1 | sort | uniq -c | sort -nr | head -10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment