# Split CSV data from beats

**URL:** <https://discuss.elastic.co/t/split-csv-data-from-beats/122607>\
**Category:** Logstash\
**Created:** [March 5, 2018, 10:41pm UTC](https://discuss.elastic.co/t/split-csv-data-from-beats/122607 "2018-03-05T22:41:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![millerb1](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@millerb1](https://discuss.elastic.co/u/millerb1)\
**Post date:** [March 5, 2018, 10:41pm UTC](https://discuss.elastic.co/t/split-csv-data-from-beats/122607/1 "2018-03-05T22:41:50Z")

</div>

We are new to ELK and need help with our Log Stash filter. We don’t need to filter any rows, **just separate the data into their respective columns and use the Timestamp column as a Timestamp**

\*.log  File Beats  Log Stash  Elastic Search  
Log files are text based CSV using “|” as a separator  
Each log line begins with [  
Log lines may span multiple rows  
Log line format: [Timestamp]|UtcOffset|Level|Code|Reference|Message

[2018-03-05 15:26:36.456]|-420|DEBUG|C001|row: 1|my useful message  
[2018-03-05 15:29:05.137]|-420|INFO|C042|emp: 1002|another useful log message

What I have so far:  
input {  
beats {  
host =\> "localhost"  
port =\> "5044"  
}  
}

filter {  
csv {  
columns =\> ["TimeStamp","UtcOffset","Level","Code","Reference","Message"]  
separator =\> "|"  
skip\_empty\_columns =\> "true"  
}  
}

output {  
elasticsearch {  
hosts =\> "localhost:9200"  
index =\> "PSS\_Log\_%{+YYYY.MM.dd}"  
}

```
stdout { }

```

}

---

<div class="post-metadata">

**Author:** ![tag\_v](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tag_v/32/47466_2.png) [@tag\_v](https://discuss.elastic.co/u/tag_v)\
**Post date:** [March 6, 2018, 5:46am UTC](https://discuss.elastic.co/t/split-csv-data-from-beats/122607/2 "2018-03-06T05:46:42Z")

</div>

> [@millerb1](#):
>
> just separate the data into their respective columns

With csv filter you wrote can do this.

> [@millerb1](#):
>
> use the Timestamp column as a Timestamp

```
date {
    match => ["TimeStamp", "TIMESTAMP_ISO8601"] // This will match timestamp and put in @timestamp field
  }

```

If you want to remove from Timestamp field you can use `gsub` to remove them before applying `date` filter.

---

<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:** [April 3, 2018, 5:46am UTC](https://discuss.elastic.co/t/split-csv-data-from-beats/122607/3 "2018-04-03T05:46:54Z")

</div>

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