# Logstash Pipeline CSV Date Filter Issue

**URL:** <https://discuss.elastic.co/t/logstash-pipeline-csv-date-filter-issue/282994>\
**Category:** Logstash\
**Created:** [September 1, 2021, 6:34am UTC](https://discuss.elastic.co/t/logstash-pipeline-csv-date-filter-issue/282994 "2021-09-01T06:34:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![piotr.krupinski](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@piotr.krupinski](https://discuss.elastic.co/u/piotr.krupinski)\
**Post date:** [September 1, 2021, 6:34am UTC](https://discuss.elastic.co/t/logstash-pipeline-csv-date-filter-issue/282994/1 "2021-09-01T06:34:07Z")

</div>

Hello,

I have an issue with pipeline which should fetch data from CSV file. When I'm adding a "Data" to filter section because I need to have it in Elastic as a date it does not want to work.

The config is below:

input {  
file {  
path =\> "${STATEMENT\_FILEPATH}/csv\_test7.csv"  
start\_position =\> "beginning"  
sincedb\_path =\> "/dev/null"  
}  
}  
filter {  
csv {  
separator =\> ","  
skip\_header =\> "true"  
columns =\> ["No.","Time","Source","Destination","Protocol","Length","Info"]  
convert =\> {  
"No." =\> "integer"  
"Time" =\> "date\_time"  
}  
}  
date {  
match =\> ["Time", "ISO8601"]  
timezone =\> "Europe/Warsaw"  
target =\> "Time"  
}  
}  
output {  
elasticsearch {  
hosts =\> ["${ES\_HOST1}","${ES\_HOST2}","${ES\_HOST3}"]  
index =\> "csv\_test7"  
#document\_id =\> "%{[@metadata][fingerprint]}"  
user =\> "${logstash\_user}"  
password =\> "${logstash\_password}"  
ssl =\> true  
ssl\_certificate\_verification =\> false  
cacert =\> "${CACERT}"  
}  
}

Data looks like below:

 ![csv_test7](https://us1.discourse-cdn.com/elastic/original/3X/1/2/123b1a8cdd5a3d08b8c9bd950e8df1707ec094d6.jpeg)

---

<div class="post-metadata">

**Author:** ![praveenkukreja](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/praveenkukreja/32/94046_2.png) [@praveenkukreja](https://discuss.elastic.co/u/praveenkukreja)\
**Post date:** [September 1, 2021, 10:40am UTC](https://discuss.elastic.co/t/logstash-pipeline-csv-date-filter-issue/282994/2 "2021-09-01T10:40:53Z")

</div>

Hey, you don't need to convert `Time` to date\_time try using this in filter block:

```auto
filter {
	csv {
		separator => ","
		skip_header => "true"
		columns => ["No.","Time","Source","Destination","Protocol","Length","Info"]
	convert => 
			{
			"No." => "integer"
		}
	}
	date {
		match => ["Time", "ISO8601"]
		timezone => "Europe/Warsaw"
		target => "Time"
	}
}

```

Always make sure to press ctrl+ E to format the code you are placing in the question.

---

<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 29, 2021, 10:41am UTC](https://discuss.elastic.co/t/logstash-pipeline-csv-date-filter-issue/282994/3 "2021-09-29T10:41:20Z")

</div>

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