# Generate multiple types with different csv

**URL:** <https://discuss.elastic.co/t/generate-multiple-types-with-different-csv/271797>\
**Category:** Logstash\
**Created:** [April 30, 2021, 2:53pm UTC](https://discuss.elastic.co/t/generate-multiple-types-with-different-csv/271797 "2021-04-30T14:53:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpb\_2000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dpb_2000/32/88027_2.png) [@dpb\_2000](https://discuss.elastic.co/u/dpb_2000)\
**Post date:** [April 30, 2021, 2:53pm UTC](https://discuss.elastic.co/t/generate-multiple-types-with-different-csv/271797/1 "2021-04-30T14:53:33Z")

</div>

Hi, I am trying to generate various _types in the same index_ based on various csv. As I don´t know the amount of csv, making an input for each one would be non-viable.  
So does anyone know how to generate types with the _names of the files_ and in those, introduce the csv respectively?

```auto
input {
  file {
    path => "/home/user/Documents/data/*.csv"
    start_position => "beginning"
    sincedb_path => "/dev/null"
  } 
}

filter { 
	
	csv {
		separator => ","
		skip_header => "true"
		autodetect_column_names => true
		autogenerate_column_names => true
	}
}

output {
   elasticsearch {
     hosts => "http://localhost:9200"
     index => "final_index"

  }

stdout {}

}

```

Thank you so much

---

<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:** [May 28, 2021, 2:54pm UTC](https://discuss.elastic.co/t/generate-multiple-types-with-different-csv/271797/2 "2021-05-28T14:54:21Z")

</div>

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