# Individual index for each csv

**URL:** https://discuss.elastic.co/t/individual-index-for-each-csv/88071
**Category:** Logstash
**Created:** [June 2, 2017, 11:08am UTC](https://discuss.elastic.co/t/individual-index-for-each-csv/88071 "2017-06-02T11:08:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Pokecallum](https://avatars.discourse-cdn.com/v4/letter/p/d6d6ee/32.png) [@Pokecallum](https://discuss.elastic.co/u/Pokecallum)
#### Post date: [June 2, 2017, 11:08am UTC](https://discuss.elastic.co/t/individual-index-for-each-csv/88071/1 "2017-06-02T11:08:26Z")

</div>

Here is my current logstash config, What I would like for each file is to have its own index starting with a string so for example

string+Jan01  
string+Jan02  
so on

Any help appreciated !!

```
input {
    file {
        type => "csv"
        path => "/home/callum/Desktop/usb/*.csv"
        start_position => beginning
    }
}

filter {
        csv {
		separator => ","
		columns => ["Date","Network","Event Type","Device","Username","File","Size"]
  }
        date { 
		match => ["Date", "yyyy/MM/dd HH:mm:ss ZZZ"]
  }
        mutate {
		add_field => {"hour"=>"%{+HH}"}
		remove_field => ["message","path","host","type","@version"]
		lowercase => ["Date","Event Type","Device","Username","File","Size"]
  }
	mutate {
	
		convert => {"hour" => "integer"}
		convert => {"Size" => "integer"}
    }
}
output {
        elasticsearch {
        hosts => "http://localhost:9200"
        index => "lumension"
     }
stdout { codec => rubydebug }
    }
```

---

<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: [June 30, 2017, 11:08am UTC](https://discuss.elastic.co/t/individual-index-for-each-csv/88071/2 "2017-06-30T11:08:42Z")

</div>

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