Skip to content

Instantly share code, notes, and snippets.

View ArthurRocha's full-sized avatar

Arthur Rocha ArthurRocha

  • Florianópolis / SC
View GitHub Profile
@ArthurRocha
ArthurRocha / log-config.js
Last active December 19, 2018 18:38
NodeJs Logs AWS Cloudwatch Winston - Encapsulation of standard output and sending logs to cloudwatch (console.log... error warn info debug). Just call once 'require('./config/log-config');' on your app initialization
'use strict';
var util = require('util'),
winston = require('winston'),
WinstonCloudWatch = require('winston-cloudwatch');
winston.add(new WinstonCloudWatch({
logGroupName: 'YOUR_GROUP_NAME',
logStreamName: 'YOUR_APP_NAME',
@ArthurRocha
ArthurRocha / Athena ALB - Partitioned logs
Last active July 3, 2020 12:49
AWS Athena create table statement for Application Load Balancer logs (partitioned)
CREATE EXTERNAL TABLE IF NOT EXISTS {{DATABASE_NAME.TABLE_NAME}} (
type string,
time string,
elb string,
client_ip string,
client_port string,
target string,
request_processing_time int,
target_processing_time int,
response_processing_time int,