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
#!/usr/bin/env python | |
import os | |
import requests | |
import boto3 | |
import base64 | |
import argparse | |
from getpass import getpass | |
from bs4 import BeautifulSoup as bs |
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
#!/usr/bin/env python | |
from boto.connection import AWSAuthConnection | |
import requests | |
import json | |
import sys | |
def main(): | |
host = sys.argv[1] |
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
##################################################################################### | |
### 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:*******:************:**********" |
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
################################################## | |
### 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"] |
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
################################################## | |
### 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>" |
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
################################################## | |
### Elasticsearch host name | |
ES_HOST = "search-******************.ap-northeast-1.es.amazonaws.com" | |
### Elasticsearch prefix for index name | |
INDEX_PREFIX = "elb_log" | |
### ELB name for type name | |
ELB_NAME = "*****" |
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 elasticsearch.connection.http_requests import RequestsHttpConnection | |
from botocore.awsrequest import AWSRequest | |
from botocore.auth import SigV4Auth | |
from botocore.credentials import Credentials | |
from botocore.utils import InstanceMetadataFetcher | |
from elasticsearch.compat import urlencode | |
import os | |
try: | |
import requests | |
REQUESTS_AVAILABLE = True |
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
input { | |
s3 { | |
bucket => "<CLOUDFRONT_LOG_BUCKET>" | |
prefix => "<CLOUDFRONT_LOG_KEY_PREFIX>" | |
region => "<BUCKET_REGION_NAME>" | |
} | |
} | |
filter { |
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
{ | |
"template": "cloudfront-logs-*", | |
"mappings": { | |
"logs": { | |
"_source": { | |
"enabled": false | |
}, | |
"_all": { | |
"enabled": false | |
}, |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
DOCUMENTATION = ''' | |
--- | |
module: swap | |
author: Shinji Fujimoto | |
short_description: Managed OS Swap space | |
requirements: None | |
description: |
OlderNewer