Logstash: ArgumentError: malformed format string - %a

Custom filter fails with field containing '%' sign.

I have created a custom filter where I am doing comparison operations on the one of the field,
while comparing the values I am using 'include' and 'empty' method of strings.

It was giving 'ArgumentError: malformed format string - %a' exception. After spending enough time
I've figured that, it is because one of the field containing '%' sign.
For now I've fixed this by replacing '%' by '%%' in the actual CSV file but I don't think this is a proper
solution.
Suggest if someone has a solution.

Please show us your filter.