-
-
Save xriu/21c9adeb4f2610166a9f577751d84925 to your computer and use it in GitHub Desktop.
Logstash cloudwatch output sample pipeline
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
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