# Logstash csv parser with single and double quotes

**URL:** https://discuss.elastic.co/t/logstash-csv-parser-with-single-and-double-quotes/366437
**Category:** Logstash
**Created:** [September 11, 2024, 10:27pm UTC](https://discuss.elastic.co/t/logstash-csv-parser-with-single-and-double-quotes/366437 "2024-09-11T22:27:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![shmesh](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@shmesh](https://discuss.elastic.co/u/shmesh)
#### Post date: [September 11, 2024, 10:27pm UTC](https://discuss.elastic.co/t/logstash-csv-parser-with-single-and-double-quotes/366437/1 "2024-09-11T22:27:48Z")

</div>

I'm having a hard time processing logs with the logstash csv filter, my logs are in a csv format with tab delimited, it has fields which may contain single quotes and also it contains json objects,

```auto
http://www.example.com/TIGER'S-EYE	\N	\N	\N 15:5 12:5 1:35 14:44 74:100	\N	{ "Referer" : "https://www.google.com/", "User-Agent" : "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"}	\N	\N	\N	1000007272642	\N

```

I have tried adding the quote\_char =\> "'" option and this fixed the logs which contain json but still having an issue with logs which contains a single quote I'm getting an error "logstash malformedcsverror: illegal quoting in line 1"

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [September 11, 2024, 11:36pm UTC](https://discuss.elastic.co/t/logstash-csv-parser-with-single-and-double-quotes/366437/2 "2024-09-11T23:36:47Z")

</div>

If your log lines do not follow CSV quoting conventions then you will not be able to parse them using a csv filter. You may have to use mutate+split and then mutate+rename to parse them.
