Skip to content

Instantly share code, notes, and snippets.

View jmosul's full-sized avatar

James jmosul

View GitHub Profile
@DV8FromTheWorld
DV8FromTheWorld / alb-log-to-csv.js
Created January 11, 2021 17:56
AWS ALB access log file to CSV
const fs = require('fs')
const path = require('path')
const util = require('util')
const { exec } = require('child_process')
const fsPromises = fs.promises
const execPromise = util.promisify(exec)
const columnHeaders = ["type", "time", "elb", "client:port", "target:port", "request_processing_time", "target_processing_time", "response_processing_time", "elb_status_code", "target_status_code", "received_bytes", "sent_bytes", "request", "user_agent", "ssl_cipher", "ssl_protocol", "target_group_arn", "trace_id", "domain_name", "chosen_cert_arn", "matched_rule_priority", "request_creation_time", "actions_executed", "redirect_url", "error_reason", "target:port_list", "target_status_code_list", "classification", "classification_reason"]