# Csv file with escape character

**URL:** <https://discuss.elastic.co/t/csv-file-with-escape-character/120140>\
**Category:** Logstash\
**Created:** [February 16, 2018, 9:56am UTC](https://discuss.elastic.co/t/csv-file-with-escape-character/120140 "2018-02-16T09:56:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![krrohit0604](https://avatars.discourse-cdn.com/v4/letter/k/9d8465/32.png) [@krrohit0604](https://discuss.elastic.co/u/krrohit0604)\
**Post date:** [February 16, 2018, 9:56am UTC](https://discuss.elastic.co/t/csv-file-with-escape-character/120140/1 "2018-02-16T09:56:09Z")

</div>

i have a csv file to index.  
some records are split in multiple lines as one of the column contains double quotes as escape character.  
eg:  
lin1: 870525,abc,Inner User,Minor,2018-01-14 02:22:34,Management,Log in to the server,Network Management,Succeeded,User name: abc,2018-01-14 02:22:35  
line2: 870526,abc,Inner User,Minor,2018-01-14 02:45:25,Management,Lock terminal,Network Management,Succeeded,"User name: abc  
line:3 Terminal: 100.256.125",2018-01-14 02:45:25  
line4:870527,abc,Inner User,Minor,10.119.136.175,2018-01-14 02:59:49,Management,Unlock terminal,Network Management,Succeeded,User name: abc  
Terminal: 125.256,2018-01-14 02:59:49

line 2 and 3 corresponds to same records. and should be in the same line. Note: there is a double quotes as escape character in line 2.

can some one suggest a pattern to handle this ?

Thanks,  
Rohit

---

<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:** [February 24, 2018, 3:15pm UTC](https://discuss.elastic.co/t/csv-file-with-escape-character/120140/2 "2018-02-24T15:15:28Z")

</div>

Doesn't the csv filter handle this out of the box?

---

<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 24, 2018, 3:15pm UTC](https://discuss.elastic.co/t/csv-file-with-escape-character/120140/3 "2018-03-24T15:15:56Z")

</div>

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