# How can i parse the data with comma seperated in logstash

**URL:** <https://discuss.elastic.co/t/how-can-i-parse-the-data-with-comma-seperated-in-logstash/153880>\
**Category:** Logstash\
**Created:** [October 24, 2018, 10:38pm UTC](https://discuss.elastic.co/t/how-can-i-parse-the-data-with-comma-seperated-in-logstash/153880 "2018-10-24T22:38:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajkumar.m](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rajkumar.m](https://discuss.elastic.co/u/rajkumar.m)\
**Post date:** [October 24, 2018, 10:38pm UTC](https://discuss.elastic.co/t/how-can-i-parse-the-data-with-comma-seperated-in-logstash/153880/1 "2018-10-24T22:38:00Z")

</div>

I have the below log format which is sending it to logstash through filebeat.  
I would like to create fields from these and send it to kibana.

server1, cpu, 10, xinfo xyz wwer 2, xyzz  
server2, mem, 25 , xyzinfo abc 12345 abinfo, 234info , abcd

basically i am looking for filter which can create fields by using comma separator.  
The log file is not a csv format file, its a plain text file.  
can someone please help

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 24, 2018, 10:52pm UTC](https://discuss.elastic.co/t/how-can-i-parse-the-data-with-comma-seperated-in-logstash/153880/2 "2018-10-24T22:52:07Z")

</div>

[https://www.elastic.co/guide/en/logstash/6.4/plugins-filters-csv.html](https://www.elastic.co/guide/en/logstash/6.4/plugins-filters-csv.html) should be what you want.

---

<div class="post-metadata">

**Author:** ![rajkumar.m](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rajkumar.m](https://discuss.elastic.co/u/rajkumar.m)\
**Post date:** [October 24, 2018, 10:56pm UTC](https://discuss.elastic.co/t/how-can-i-parse-the-data-with-comma-seperated-in-logstash/153880/3 "2018-10-24T22:56:02Z")

</div>

thanks Warkolm,

## i have tried like below. if the file is not csv formatted, will the cvs filter works? please let me know do i need to use grok after csv?

filter {

```
    if [type] == "log" and [log_type] == "winlog" {
            csv {
                    columns => [
                    "HostName",
                    "Metric",
                    "Usage"
                    ]
                    separator => ","
            }
  }

```

## }

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 24, 2018, 10:56pm UTC](https://discuss.elastic.co/t/how-can-i-parse-the-data-with-comma-seperated-in-logstash/153880/4 "2018-10-24T22:56:47Z")

</div>

That should work fine, you won't need grok.

---

<div class="post-metadata">

**Author:** ![balumurari1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/balumurari1/32/39203_2.png) [@balumurari1](https://discuss.elastic.co/u/balumurari1)\
**Post date:** [October 25, 2018, 6:58am UTC](https://discuss.elastic.co/t/how-can-i-parse-the-data-with-comma-seperated-in-logstash/153880/5 "2018-10-25T06:58:23Z")

</div>

hope this example helps you,

> [@Load csv file in logstash](https://discuss.elastic.co/t/load-csv-file-in-logstash/151319):
>
> Please provide sample examples to upload csv, pdf files in logstash

---

<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:** [November 22, 2018, 6:58am UTC](https://discuss.elastic.co/t/how-can-i-parse-the-data-with-comma-seperated-in-logstash/153880/6 "2018-11-22T06:58:27Z")

</div>

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