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
-- This creates an athena table that can parse ALB logs. | |
-- Advantage of this over others are this works when the log ends with a trailing space | |
-- plus it also breaks the http request into route and params for easier grouping | |
CREATE EXTERNAL TABLE IF NOT EXISTS alb_logs ( | |
type string, | |
timestamp string, | |
elb string, | |
client_ip string, | |
client_port int, |
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
from sqlalchemy import create_engine | |
from sqlalchemy.ext.declarative import declarative_base | |
engine = create_engine("postgresql://user:@host/schema") | |
Base = declarative_base() | |
Base.metadata.reflect(engine) |