Skip to content

Instantly share code, notes, and snippets.

@srkiNZ84
Last active March 8, 2018 02:04
Show Gist options
  • Save srkiNZ84/9044e06b605fd6459f657374e52bd17c to your computer and use it in GitHub Desktop.
Save srkiNZ84/9044e06b605fd6459f657374e52bd17c to your computer and use it in GitHub Desktop.
Simple python script to parse AWS ELB logs and look for HTTP 503 responses
#!/usr/bin/python
import sys
logLines = sys.stdin.readlines()
for line in logLines:
#print("line is: " + line)
tokens = line.split(" ")
#print("elb status code: " + tokens[8])
if(tokens[8].startswith("5")):
print("Found HTTP 5XX")
print(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment