# Logstash comma delimited csv file with quoted strings

**URL:** https://discuss.elastic.co/t/logstash-comma-delimited-csv-file-with-quoted-strings/258671
**Category:** Logstash
**Created:** [December 15, 2020, 5:13am UTC](https://discuss.elastic.co/t/logstash-comma-delimited-csv-file-with-quoted-strings/258671 "2020-12-15T05:13:05Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nameisnotimportant](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@nameisnotimportant](https://discuss.elastic.co/u/nameisnotimportant)
#### Post date: [December 15, 2020, 5:13am UTC](https://discuss.elastic.co/t/logstash-comma-delimited-csv-file-with-quoted-strings/258671/1 "2020-12-15T05:13:05Z")

</div>

Hi,

I have following comma delimited csv file, which content has a comma in some of the columns.

> ```
> LogTime,Level,ApplicationId,UserId,ProcessId,FormId,Action,Status,Reference,TranRef,IP,SessionId,CIF_REF_NO,UserAgent
> 11-12-2020 00:00:00,INF,Investor,"2D5D066C-DE96-41D9-8F49-B0F2211D46FF","FIRSTTIME_LOGIN","FIRSTTIME_LOGIN",RequestPAC,S,"Uid:CII0700000242495,",,118.101.247.211,sf3wkj25s1udkn5fynn5ikj0,CII0700000242495,"Mozilla/5.0 (Linux; Android 10; LYA-L29 Build/HUAWEILYA-L29; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/87.0.4280.101 Mobile Safari/537.36","" 
> 
> ```

Error message when i run it in logstash:

> Error parsing csv.... :exception=\>#\<CSV::MalformedCSVError: Missing or stray quote in line 1\>}

I am reading the file with following:

> ```
> filter {
> csv {
> separator => ","
> columns => ["LogTime","Level","ApplicationId","UserId","ProcessId","FormId","Action","Status","Reference","TranRef","IP","SessionId","CIF_REF_NO","UserAgent"]    
> skip_empty_columns => "true"
> }
> 
> ```

May i know how should i deal with these type of csv files ?  
\*note: i can't change the source to use different delimiter.

Regards.

---

<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: [January 12, 2021, 5:13am UTC](https://discuss.elastic.co/t/logstash-comma-delimited-csv-file-with-quoted-strings/258671/2 "2021-01-12T05:13:12Z")

</div>

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