Fix for https://logstash.jira.com/browse/LOGSTASH-1371