# Logstash: ArgumentError: malformed format string - %a

**URL:** <https://discuss.elastic.co/t/logstash-argumenterror-malformed-format-string-a/38837>\
**Category:** Logstash\
**Created:** [January 11, 2016, 7:04am UTC](https://discuss.elastic.co/t/logstash-argumenterror-malformed-format-string-a/38837 "2016-01-11T07:04:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![krushnat\_khawale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krushnat_khawale/32/6652_2.png) [@krushnat\_khawale](https://discuss.elastic.co/u/krushnat_khawale)\
**Post date:** [January 11, 2016, 7:04am UTC](https://discuss.elastic.co/t/logstash-argumenterror-malformed-format-string-a/38837/1 "2016-01-11T07:04:12Z")

</div>

## 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.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [January 11, 2016, 7:19am UTC](https://discuss.elastic.co/t/logstash-argumenterror-malformed-format-string-a/38837/2 "2016-01-11T07:19:23Z")

</div>

Please show us your filter.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 5:16am UTC](https://discuss.elastic.co/t/logstash-argumenterror-malformed-format-string-a/38837/3 "2017-07-06T05:16:10Z")

</div>

Closed on July 6, 2017, 5:16am UTC


