Skip to content

Instantly share code, notes, and snippets.

View slowquerylog-to-es-lambda.py
##################################################
### Elasticsearch host name
ES_HOST = "search-*******************.ap-northeast-1.es.amazonaws.com"
### Elasticsearch prefix for index name
INDEX_PREFIX = "slowquerylog"
### Elasticsearch type name is rds instance id
RDS_ID = "<RDS_INSTANCE_IDENTIFY>"
@s-fujimoto
s-fujimoto / s3-to-es-lamba.py
Created Nov 14, 2015
Import Elasticsearch from ELB access log for AWS Lambda Function
View s3-to-es-lamba.py
##################################################
### Elasticsearch host name
ES_HOST = "search-******************.ap-northeast-1.es.amazonaws.com"
### Elasticsearch prefix for index name
INDEX_PREFIX = "awslogs"
#################################################
### ELB access log format keys
ELB_KEYS = ["timestamp", "elb", "client_ip", "client_port", "backend_ip", "backend_port", "request_processing_time", "backend_processing_time", "response_processing_time", "elb_status_code", "backend_status_code", "received_bytes", "sent_bytes", "request_method", "request_url", "request_version", "user_agent"]
@s-fujimoto
s-fujimoto / collect_vulnerability.py
Last active Oct 21, 2018
collect vulnerability for AWS Lambda
View collect_vulnerability.py
#####################################################################################
### Select from low, middle, high. If you choice middle, script collect middle and high.
SEVERITY = "middle"
### Select from daily, weekly, monthly
INTERVAL = "daily"
### Specify Publish Topic Arn for SNS
TOPIC_ARN = "arn:aws:sns:*******:************:**********"
@s-fujimoto
s-fujimoto / request_amazon_es.py
Last active Jan 17, 2020
request to amazon es controled iam policy
View request_amazon_es.py
#!/usr/bin/env python
from boto.connection import AWSAuthConnection
import requests
import json
import sys
def main():
host = sys.argv[1]
View assume_role_for_adfs.py
#!/usr/bin/env python
import os
import requests
import boto3
import base64
import argparse
from getpass import getpass
from bs4 import BeautifulSoup as bs