logstash-plugins / logstash-input-cloudwatch

A Logstash input to pull events from the Amazon Web Services CloudWatch API
Apache License 2.0
43 stars 28 forks source link

Is "filters" an array or a hash? #52

Open nick-george opened 5 years ago

nick-george commented 5 years ago

Hi,

I'm reading the docs and the source code for this input plugin and you've said that the filter parameter is to be provided as an array, however all your examples show the filter as a hash. For example:

filters => { "tag:Group" => "API-Production" }

I'm confused. Is the filter an array or a hash? It certainly looks like a hash to me. I'm curious how the validation in the input source code would allow this?

config :filters, :validate => :array

Could you please shed some light on this for me?

Many thanks, Nick

badgerparade commented 5 years ago

I think it's a hash, wish it was an array as I've being trying to get out service level metrics for ECS but it's multi dimensional requiring the ClusterName and ServiceName so been hitting a wall.

nick-george commented 5 years ago

Thanks Gavin. I wonder how the filter can accept a hash when it's supposed to 'validate' it as an array. Maybe ruby can treat any has as an array by flattening it. Kinda defeats the purpose of the validation if you ask me. Would be kinda nice if one of the filter authors could clarify.

siddheshkerkar commented 5 years ago

I am facing the same issue while fetching metrics for ECS. any update on this requirement?

siddheshkerkar commented 5 years ago

Got that working with:

filters => { "dimention1" => "value1" "dimention2" => "value2" } combined => true

This multiple parameter structure is not mentioned anywhere in documentation. Got the reference from Pull Request

Thanks.