# How to let Logstash read all my Input texts Files automatically

**URL:** <https://discuss.elastic.co/t/how-to-let-logstash-read-all-my-input-texts-files-automatically/171724>\
**Category:** Logstash\
**Created:** [March 11, 2019, 10:18am UTC](https://discuss.elastic.co/t/how-to-let-logstash-read-all-my-input-texts-files-automatically/171724 "2019-03-11T10:18:08Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![samyo](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@samyo](https://discuss.elastic.co/u/samyo)\
**Post date:** [March 11, 2019, 10:18am UTC](https://discuss.elastic.co/t/how-to-let-logstash-read-all-my-input-texts-files-automatically/171724/1 "2019-03-11T10:18:08Z")

</div>

Hello Folks,  
i need some help to know if its Possible, to let Logstash read my 1000 Textfiles separately and automatically from the Input.  
I have about 1000 textfiles , each textfile has his name and different text inside.  
I already wrote my filter in Logstash to read this texts, but the Question is :  
Can Logstash read all those textfiles separately and automatically from my Input???  
Is there any Command for that ?  
does anybody have an Idea about that?

Thx.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [March 11, 2019, 12:42pm UTC](https://discuss.elastic.co/t/how-to-let-logstash-read-all-my-input-texts-files-automatically/171724/2 "2019-03-11T12:42:37Z")

</div>

You can use a [file](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-file.html) input with a path regex (or regexes) that match those files.

---

<div class="post-metadata">

**Author:** ![samyo](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@samyo](https://discuss.elastic.co/u/samyo)\
**Post date:** [March 11, 2019, 12:58pm UTC](https://discuss.elastic.co/t/how-to-let-logstash-read-all-my-input-texts-files-automatically/171724/3 "2019-03-11T12:58:07Z")

</div>

hello Badger,  
that is my Input Config , after i created a folder includes my all textfiels inside.  
input  
{ type =\> "log"  
path =\> "C:\Users\samyo\Desktop\ELK\folder\log\*"  
#path =\> "C:\Users\samyo\Desktop\ELK\folder\((?:.(?!\))+.log)"  
start\_position =\> "beginning"  
exclude =\> "\*.gz"  
}}

but it stills could not read the textfiels inside the "folder" wich i created?  
can you please correct my Input config above?

thx.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [March 11, 2019, 2:03pm UTC](https://discuss.elastic.co/t/how-to-let-logstash-read-all-my-input-texts-files-automatically/171724/4 "2019-03-11T14:03:05Z")

</div>

Try adding [sincedb\_path](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-file.html#_tracking_of_current_position_in_watched_files) =\> "NUL".

---

<div class="post-metadata">

**Author:** ![samyo](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@samyo](https://discuss.elastic.co/u/samyo)\
**Post date:** [March 11, 2019, 2:31pm UTC](https://discuss.elastic.co/t/how-to-let-logstash-read-all-my-input-texts-files-automatically/171724/5 "2019-03-11T14:31:26Z")

</div>

i tried it too , still Logstash could not **go inside the "folder" and get the textfiles to read them,**  
it seems Logstash can not read a lot of Inputs automatically .  
i tried to put just two paths for two differen textfiels and it works  
path =\> "C:\Users\samyo\Desktop\ELK\inputtest1.log"  
path =\> "C:\Users\samyo\Desktop\ELK\inputtest2.log"

, but after adding manually 3 paths separately for 3 different textfiels , logstash was not able more to read those 3 textfiles.

any Suggestions ?  
thx.

---

<div class="post-metadata">

**Author:** ![Ganesh2303](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Ganesh2303](https://discuss.elastic.co/u/Ganesh2303)\
**Post date:** [March 11, 2019, 2:34pm UTC](https://discuss.elastic.co/t/how-to-let-logstash-read-all-my-input-texts-files-automatically/171724/6 "2019-03-11T14:34:22Z")

</div>

check whether your log file contain new line at end of the file.

---

<div class="post-metadata">

**Author:** ![samyo](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@samyo](https://discuss.elastic.co/u/samyo)\
**Post date:** [March 11, 2019, 2:41pm UTC](https://discuss.elastic.co/t/how-to-let-logstash-read-all-my-input-texts-files-automatically/171724/7 "2019-03-11T14:41:06Z")

</div>

that is my Log config file all about , i even tried different ways of "path" as you can see,  
what do you mean with "new line at the end of file" ? Can you please adjust my input?  
input  
{ type =\> "log"  
path =\> "C:\Users\samyo\Desktop\ELK\folder\*.log"  
#path =\> "C:\Users\samyo\Desktop\ELK\folder((?:.(?!))+.log)"  
#path =\> "C:\Users\samyo\Desktop\ELK\folder\log\*"  
start\_position =\> "beginning"  
sincedb\_path =\> "NUL"  
exclude =\> "\*.gz"  
}}

---

<div class="post-metadata">

**Author:** ![Ganesh2303](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Ganesh2303](https://discuss.elastic.co/u/Ganesh2303)\
**Post date:** [March 11, 2019, 2:42pm UTC](https://discuss.elastic.co/t/how-to-let-logstash-read-all-my-input-texts-files-automatically/171724/8 "2019-03-11T14:42:18Z")

</div>

> [@samyo](#):
>
> "new line at the end of file"

I'm not saying your configuration file and i'm talking about log file which your parsing into logstash

---

<div class="post-metadata">

**Author:** ![samyo](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@samyo](https://discuss.elastic.co/u/samyo)\
**Post date:** [March 11, 2019, 2:47pm UTC](https://discuss.elastic.co/t/how-to-let-logstash-read-all-my-input-texts-files-automatically/171724/9 "2019-03-11T14:47:52Z")

</div>

yes of course my textfiels have text after each text i pressed Enter for a new Line and saved it , still did not work , i know that logstash can not do that by it self , so i did it inorder to help logstash , still could not get the textfiels from the "folder" .

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [March 11, 2019, 2:50pm UTC](https://discuss.elastic.co/t/how-to-let-logstash-read-all-my-input-texts-files-automatically/171724/10 "2019-03-11T14:50:58Z")

</div>

Use forward slash instead of backslash in those paths.

---

<div class="post-metadata">

**Author:** ![samyo](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@samyo](https://discuss.elastic.co/u/samyo)\
**Post date:** [March 11, 2019, 2:54pm UTC](https://discuss.elastic.co/t/how-to-let-logstash-read-all-my-input-texts-files-automatically/171724/11 "2019-03-11T14:54:34Z")

</div>

Badger you have right , it works now, it was all cause of the Backslash .  
i could not believe that , thank you guys so much for supporting, you are the best.  
thanx 🙂

---

<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:** [April 8, 2019, 2:54pm UTC](https://discuss.elastic.co/t/how-to-let-logstash-read-all-my-input-texts-files-automatically/171724/12 "2019-04-08T14:54:38Z")

</div>

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