# Logstash config

**URL:** <https://discuss.elastic.co/t/logstash-config/348644>\
**Category:** Logstash\
**Created:** [December 5, 2023, 1:16pm UTC](https://discuss.elastic.co/t/logstash-config/348644 "2023-12-05T13:16:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kibanauser4](https://avatars.discourse-cdn.com/v4/letter/k/ecd19e/32.png) [@kibanauser4](https://discuss.elastic.co/u/kibanauser4)\
**Post date:** [December 5, 2023, 1:16pm UTC](https://discuss.elastic.co/t/logstash-config/348644/1 "2023-12-05T13:16:17Z")

</div>

I have installed 7.15.0 version of Logstash. I have the following config file:

```auto
input {
	file {
		path => "C:/Users/ELK Stack/data/sample.csv"
		start_position => "beginning"
		sincedb_path => "NUL"
	}
}

filter {
	csv {
		separator => ","
		autodetect_column_names => true
	}
	mutate {
		remove_field => ["message", "host", "path", "@version", "@timestamp"]
	}
	mutate {
		convert => {
			"price" => "integer"
		}
	}
	date {
		match => ["expiryDate", "yyyyMMdd"]
		target => "expiryDate"
		timezone => "UTC"
	}
}

output {
	elasticsearch {
		hosts => ["http://localhost:9200"]
		index => "vehicle"
		document_id => "%{licensePlate}"
	}
}

```

But when running it with Logstash I see that the index isn't being populated correctly. The same document kept being rewritten with different values. The mappings were also wrong, for example if I had the following input file:

```auto
licensePlate,color,price,expiryDate
AB1234,blue,300000,20241115

```

one document looked like:

```auto
"AB1234": 300000

```

etc.

Can someone tell me if my config is wrong or is it some configuration that I need to fix? I have ran this exact file before and it was successful, but it was on a different laptop, so I'm not sure if I had a different configuration there maybe.

---

<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:** [January 2, 2024, 1:17pm UTC](https://discuss.elastic.co/t/logstash-config/348644/2 "2024-01-02T13:17:16Z")

</div>

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