# Logstash remove\_field not working in order to upload csv to elasticsearch

**URL:** <https://discuss.elastic.co/t/logstash-remove-field-not-working-in-order-to-upload-csv-to-elasticsearch/211206>\
**Category:** Logstash\
**Created:** [December 10, 2019, 12:58am UTC](https://discuss.elastic.co/t/logstash-remove-field-not-working-in-order-to-upload-csv-to-elasticsearch/211206 "2019-12-10T00:58:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlman001](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@carlman001](https://discuss.elastic.co/u/carlman001)\
**Post date:** [December 10, 2019, 12:58am UTC](https://discuss.elastic.co/t/logstash-remove-field-not-working-in-order-to-upload-csv-to-elasticsearch/211206/1 "2019-12-10T00:58:33Z")

</div>

I'm using elasticsearch, kibana and logstash 6.0.1.

I wish to upload csv data to elasticsearch by logstash and removing fields (path, @timestamp, @version, host and message). I'm showing logstash.conf and emp.csv files below. The upload will work if I don't use the remove\_field instruction but I need to. Furthermore, the index was not created.

logstash.conf:

```
input {

  file {
	  path => "e:\emp.csv"
	  start_position => "beginning"
  }
}
filter {
  csv {
	  separator => ","
	  columns => ["code","color"]
	  remove_field => ["path", "@timestamp", "@version", "host", "message"]
  }

  mutate {convert => ["code", "string"]}
  mutate {convert => ["color", "string"]}

}
output {
  elasticsearch {
	hosts => "http://localhost:9200"
	index => "emp5"
	user => "elastic"
	password => "password"
  }
  stdout {}
}

```

emp.csv:

```
1,blue
2,red

```

Just it case, I tried to add remove\_field to mutate but I got same results.

What is missing in this case?

---

<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 7, 2020, 12:58am UTC](https://discuss.elastic.co/t/logstash-remove-field-not-working-in-order-to-upload-csv-to-elasticsearch/211206/2 "2020-01-07T00:58:33Z")

</div>

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