# Parse a CSV file with grok logstash

**URL:** https://discuss.elastic.co/t/parse-a-csv-file-with-grok-logstash/280726
**Category:** Logstash
**Created:** [August 8, 2021, 10:42am UTC](https://discuss.elastic.co/t/parse-a-csv-file-with-grok-logstash/280726 "2021-08-08T10:42:09Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Hind](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hind/32/92669_2.png) [@Hind](https://discuss.elastic.co/u/Hind)
#### Post date: [August 8, 2021, 10:42am UTC](https://discuss.elastic.co/t/parse-a-csv-file-with-grok-logstash/280726/1 "2021-08-08T10:42:09Z")

</div>

Hello!  
How could I parse a string that is between double quotes with grok logstash.

"Kaathadimattam, Balacola Post, NEAR Siva Tea Factory, Ooty, 643203 Ooty, India – Great location -",ooty,India,.....  
thank you.

---

<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: [August 8, 2021, 2:56pm UTC](https://discuss.elastic.co/t/parse-a-csv-file-with-grok-logstash/280726/2 "2021-08-08T14:56:50Z")

</div>

What do you want to do with it? You could use a second csv filter to parse it into multiple fields, or a mutate+split filter to parse it into an array. There are many other things one could do with ruby. What do you want?

---

<div class="post-metadata">

### Author: ![Hind](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hind/32/92669_2.png) [@Hind](https://discuss.elastic.co/u/Hind)
#### Post date: [August 8, 2021, 9:38pm UTC](https://discuss.elastic.co/t/parse-a-csv-file-with-grok-logstash/280726/3 "2021-08-08T21:38:04Z")

</div>

at the beginning I imported a CSV file in elasticsearch by configuring a logstash.config file but when viewing I noticed that each record is stored in only one field so I thought to parse the fields in the grok filter logstash to properly structure my data, is that already how we work with elasticsearch?

---

<div class="post-metadata">

### Author: ![Hind](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hind/32/92669_2.png) [@Hind](https://discuss.elastic.co/u/Hind)
#### Post date: [August 8, 2021, 10:32pm UTC](https://discuss.elastic.co/t/parse-a-csv-file-with-grok-logstash/280726/4 "2021-08-08T22:32:19Z")

</div>

if you can help me,  
I parsed the data using grokdebug and it worked fine, i got the structure i wanted, but when i visualized my data via kibana's discover the structure did was not the same ... I do not understand where the problem is.  
Details are attached

(Attachment test\_grok.txt is missing)

(Attachment logstash\_spanish.config is missing)

(Attachment my\_data\_in\_kibana.txt is missing)

---

<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: [September 5, 2021, 10:32pm UTC](https://discuss.elastic.co/t/parse-a-csv-file-with-grok-logstash/280726/5 "2021-09-05T22:32:39Z")

</div>

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