# How to index multiple files of different extensions using the same .config file

**URL:** <https://discuss.elastic.co/t/how-to-index-multiple-files-of-different-extensions-using-the-same-config-file/24618>\
**Category:** Logstash\
**Created:** [June 30, 2015, 11:47am UTC](https://discuss.elastic.co/t/how-to-index-multiple-files-of-different-extensions-using-the-same-config-file/24618 "2015-06-30T11:47:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![PavanRGowda](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@PavanRGowda](https://discuss.elastic.co/u/PavanRGowda)\
**Post date:** [June 30, 2015, 11:47am UTC](https://discuss.elastic.co/t/how-to-index-multiple-files-of-different-extensions-using-the-same-config-file/24618/1 "2015-06-30T11:47:21Z")

</div>

I have two files with .xlsx and .csv extensions. I want to index both the files into elasticsearch using the same .config file. The problem is in the filter section as the separator for both the files varies. Is there any way to index both the files into elasticsearch using one .config file?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 30, 2015, 11:52am UTC](https://discuss.elastic.co/t/how-to-index-multiple-files-of-different-extensions-using-the-same-config-file/24618/2 "2015-06-30T11:52:03Z")

</div>

Okay, so the .xlsx file is actually a CSV file?

But yeah, just assign different types or different tags to the messages read by each input and use [conditionals](https://www.elastic.co/guide/en/logstash/current/configuration.html#conditionals) in the filter and/or output sections to have different filtering behavior depending on the kind of message it is.

---

<div class="post-metadata">

**Author:** ![PavanRGowda](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@PavanRGowda](https://discuss.elastic.co/u/PavanRGowda)\
**Post date:** [June 30, 2015, 12:05pm UTC](https://discuss.elastic.co/t/how-to-index-multiple-files-of-different-extensions-using-the-same-config-file/24618/3 "2015-06-30T12:05:09Z")

</div>

No, the .xlsx file is not a CSV file. I'm not able to find the separator for .xlsx file as in case of CSV file.

Here's my .config file for my CSV file -

```
                          input {  
                                    file {
                                           path => ["/home/pavan/Downloads/test//home/pavan/Downloads/test/National-Christian.csv"]				      
                                           type => "Sample"
                                           start_position => "beginning"
    				       sincedb_path => "/home/pavan/Downloads/dbflile"
                                         }
                                   }
                            filter {  
                                     csv {
                                          
                                           separator => ","
                                         }
                                   }
    
                            output { 
                                     elasticsearch { host => localhost protocol => http index => test } 
                                     stdout { codec => rubydebug } 
                                   }

```

Can you please post me the configurations for .xlsx file (City of Indian Wells Ca Bus lic info EIN.xlsx) which exist in same directory.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 30, 2015, 12:09pm UTC](https://discuss.elastic.co/t/how-to-index-multiple-files-of-different-extensions-using-the-same-config-file/24618/4 "2015-06-30T12:09:07Z")

</div>

Out of the box Logstash doesn't read .xlsx files.

---

<div class="post-metadata">

**Author:** ![PavanRGowda](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@PavanRGowda](https://discuss.elastic.co/u/PavanRGowda)\
**Post date:** [June 30, 2015, 12:29pm UTC](https://discuss.elastic.co/t/how-to-index-multiple-files-of-different-extensions-using-the-same-config-file/24618/5 "2015-06-30T12:29:39Z")

</div>

Magnusbaeck, do you have any suggestions to overcome my problem?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 30, 2015, 1:15pm UTC](https://discuss.elastic.co/t/how-to-index-multiple-files-of-different-extensions-using-the-same-config-file/24618/6 "2015-06-30T13:15:04Z")

</div>

Well, you'll have to find something that reads your Excel files and outputs them in a format that Logstash accepts.

---

<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:** [July 6, 2017, 5:35am UTC](https://discuss.elastic.co/t/how-to-index-multiple-files-of-different-extensions-using-the-same-config-file/24618/7 "2017-07-06T05:35:59Z")

</div>


