# CSV filter how to replace new line with ","

**URL:** <https://discuss.elastic.co/t/csv-filter-how-to-replace-new-line-with/119001>\
**Category:** Logstash\
**Created:** [February 8, 2018, 9:06am UTC](https://discuss.elastic.co/t/csv-filter-how-to-replace-new-line-with/119001 "2018-02-08T09:06:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![scch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/scch/32/25504_2.png) [@scch](https://discuss.elastic.co/u/scch)\
**Post date:** [February 8, 2018, 9:06am UTC](https://discuss.elastic.co/t/csv-filter-how-to-replace-new-line-with/119001/1 "2018-02-08T09:06:53Z")

</div>

Hi Magnus,  
I am parsing csv file which contain **new line** in a field. i want to replace it with ",". Tried below code. so far no success, please advice

mutate {gsub =\> ["Standard", "[\n]", ""]}

below image shows how data looks like.

![image](https://us1.discourse-cdn.com/elastic/original/3X/7/d/7d09b6d78c9eee54896b3adf9abd959f0c7646c8.png)

i want parsed data to look like below, is it possible ? if yes, what's the character for newline feedwhich Logstash recognize ...because i am able to replace other characters with above code.

**Hacking, Technology-Internet**

Thanks..

---

<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:** [March 8, 2018, 9:07am UTC](https://discuss.elastic.co/t/csv-filter-how-to-replace-new-line-with/119001/2 "2018-03-08T09:07:41Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
