# LogStash multiple files

**URL:** <https://discuss.elastic.co/t/logstash-multiple-files/122144>\
**Category:** Logstash\
**Created:** [March 1, 2018, 7:34pm UTC](https://discuss.elastic.co/t/logstash-multiple-files/122144 "2018-03-01T19:34:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShashiK](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@ShashiK](https://discuss.elastic.co/u/ShashiK)\
**Post date:** [March 1, 2018, 7:34pm UTC](https://discuss.elastic.co/t/logstash-multiple-files/122144/1 "2018-03-01T19:34:39Z")

</div>

I am restarting this question as previously i was moved to a different task so now back on this.

Logstash works for me when i have a direct file reference -  
When I use the single file reference in the logstash config-

input {  
file {  
path =\> "C:\Tools\LogRepository\transaction\Web\http\User001\_HTTPS1.csv"  
type =\> "transactions"  
start\_position =\> "beginning"  
}  
}

It works and all entries from the file - User001\_HTTPS1.csv are indexed into Elastic.  
However when I put in a generic reference -

input {  
file {  
path =\> "C:\Tools\LogRepository\transaction\Web\http\*.csv"  
type =\> "transactions"  
start\_position =\> "beginning"  
}  
}

None of the files are picked up.

Problem for me is that this location contains individual user transaction data and I cannot say how many files or specifically the name of the files in this location. - this is a direct data dump.  
the "Web" folder contains multiple folders - "http", "MQ", "FTP" etc.  
each of these folders contains a variable number of files.  
So I am wondering if logstash file filter can support a tree structure, i.e. directory containing directories containing file(s).

---

<div class="post-metadata">

**Author:** ![ShashiK](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@ShashiK](https://discuss.elastic.co/u/ShashiK)\
**Post date:** [March 1, 2018, 7:35pm UTC](https://discuss.elastic.co/t/logstash-multiple-files/122144/2 "2018-03-01T19:35:09Z")

</div>

My logstash conf file is below.

input {  
file {  
path =\> "C:\Shashi\Tools\LogRepository\transaction\Web\*\*\*.csv"  
type =\> "transactions"  
start\_position =\> "beginning"  
}  
}

filter {  
csv {  
separator =\> ","  
columns =\> ["Username", "InterfaceType", "UserType", "MessageType",  
"MessageTemplate", "StartTimeinMillis", "EndTimeinMillis",  
"StartTime", "EndTime"]  
remove\_field =\> ["path", "message"]

}

date {  
match =\> ["StartTime" , "dd-MMM-yyyy HH:mm:ss"]  
}  
}

output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "transaction\_data"  
}  
stdout {}  
}

---

<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:** [March 1, 2018, 8:03pm UTC](https://discuss.elastic.co/t/logstash-multiple-files/122144/3 "2018-03-01T20:03:10Z")

</div>

Have you tried using forward slashes instead of backslashes?

---

<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:** [March 29, 2018, 8:03pm UTC](https://discuss.elastic.co/t/logstash-multiple-files/122144/4 "2018-03-29T20:03:28Z")

</div>

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