This file contains 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
/* | |
Copyright 2014 The Kubernetes Authors. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
This file contains 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
import hashlib | |
import boto3 | |
import time | |
## CONFIG ## | |
BUCKET = 'bucket-name' | |
FILEPATH = 'hashes' | |
SEP = '\t' | |
def log(metric_name, metric_type='count', metric_value=1, tags=[]): |
This file contains 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
--- | |
kind: ReplicationController | |
apiVersion: v1 | |
metadata: | |
name: redis-master | |
labels: | |
app: redis | |
role: master | |
spec: | |
replicas: 1 |
This file contains 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
instances: | |
- host: localhost | |
port: 7100 | |
cassandra_aliasing: true | |
# user: username | |
# password: password | |
# process_name_regex: .*process_name.* # Instead of specifying a host, and port. The agent can connect using the attach api. | |
# # This requires the JDK to be installed and the path to tools.jar to be set below. | |
# tools_jar_path: /usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar # To be set when process_name_regex is set | |
# name: cassandra_instance |
This file contains 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
instances: | |
- host: localhost | |
port: 7100 | |
cassandra_aliasing: true | |
# user: username | |
# password: password | |
# process_name_regex: .*process_name.* # Instead of specifying a host, and port. The agent can connect using the attach api. | |
# # This requires the JDK to be installed and the path to tools.jar to be set below. | |
# tools_jar_path: /usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar # To be set when process_name_regex is set | |
# name: cassandra_instance |
This file contains 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
instances: | |
- host: localhost | |
port: 7100 | |
cassandra_aliasing: true | |
# user: username | |
# password: password | |
# process_name_regex: .*process_name.* # Instead of specifying a host, and port. The agent can connect using the attach api. | |
# # This requires the JDK to be installed and the path to tools.jar to be set below. | |
# tools_jar_path: /usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar # To be set when process_name_regex is set | |
# name: cassandra_instance |
This file contains 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
""" | |
Custom parser for nginx log suitable for use by Datadog 'dogstreams'. | |
To use, add to datadog.conf as follows: | |
dogstreams: [path to ngnix log (e.g: "/var/log/nginx/access.log"]:[path to this python script (e.g "/usr/share/datadog/agent/dogstream/nginx.py")]:[name of parsing method of this file ("parse")] | |
so, an example line would be: | |
dogstreams: /var/log/nginx/access.log:/usr/share/datadog/agent/dogstream/nginx.py:parse | |
Log of nginx should be defined like that: | |
log_format time_log '$time_local "$request" S=$status $bytes_sent T=$request_time R=$http_x_forwarded_for'; | |
when starting dd-agent, you can find the collector.log and check if the dogstream initialized successfully | |
""" |