Skip to content

Instantly share code, notes, and snippets.

@szinck
szinck / alb_logs.sql
Created August 13, 2017 02:21
Athena Table for ALB Logs
-- 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,
@szinck
szinck / database.py
Created May 23, 2012 04:56
sqlalchemy reflection
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)