Last active
September 10, 2020 18:16
-
-
Save BrockReece/01162ce1a55a9c4137d87b520c72772a 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
Also following up on this -- any solution or comment on this issue?