Skip to content

Instantly share code, notes, and snippets.

@xriu
Forked from BrockReece/cloudwatch-pipeline.conf
Created September 30, 2016 09:07
Show Gist options
  • Save xriu/21c9adeb4f2610166a9f577751d84925 to your computer and use it in GitHub Desktop.
Save xriu/21c9adeb4f2610166a9f577751d84925 to your computer and use it in GitHub Desktop.
Logstash cloudwatch output sample pipeline
input {
http_poller {
urls => {
node => {
method => get
url => "http://localhost:9200/_cluster/health"
headers => {
Accept => "application/json"
}
}
}
request_timeout => 10
interval => 10
codec => "json"
type => 'cloudwatch'
}
}
filter {
if [type] == "cloudwatch" {
mutate {
add_field => ["CW_metricname", "ElasticNodes"]
add_field => ["CW_unit", "Count"]
add_field => ["CW_value", "%{number_of_nodes}"]
add_field => ["CW_dimensions", "Cluster", "CW_dimensions", "%{cluster_name}"]
}
}
}
output {
if [type] == "cloudwatch" {
cloudwatch {
access_key_id => "MYACCESSID"
secret_access_key => "SECRET"
region => "eu-west-1"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment