The statsd output has a sample_rate parameter.
The default value is 1 or 100% sampling.
But let's try to set 50% sampling.
If you use 0.5 without quotes, logstash gives a config file syntax error:
If you use a quotes value like '0.5', nothing to send to statsd. As suggested by 'Jon' on groups (https://groups.google.com/forum/#!topic/logstash-users/EMzzjJCVujM) the '0.5' seems to be converted to 0, or 'never'.
I work with 1.1.13. I guess 1.2.0 and 1.2.1 have the same issue as I have not seen any related codechanges.
Found the cause.
Logstash does not allow floats as parameter values (only 'string', 'number' and some unrelated).
If you apply the following patches setting the sample_rate will work:
Thanks for your work to debug this!
The bug was that the logstash config parser was forcing 'number' validations to be integers. I've fixed it in master and this will show up in the next release.
The problem is the plugin setting validation was turning 0.5 into 0 (a bug).
I've merged a fix into master and this will be available in the next release.