# Logstash read file in what order?

**URL:** <https://discuss.elastic.co/t/logstash-read-file-in-what-order/274549>\
**Category:** Logstash\
**Created:** [May 31, 2021, 9:19pm UTC](https://discuss.elastic.co/t/logstash-read-file-in-what-order/274549 "2021-05-31T21:19:35Z")\
**Posts on this page:** 3\
**Page:** 2

<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:** [June 3, 2021, 2:45am UTC](https://discuss.elastic.co/t/logstash-read-file-in-what-order/274549/21 "2021-06-03T02:45:05Z")

</div>

I think the file input is using the [Dir.glob](https://ruby-doc.org/core-3.0.1/Dir.html#method-c-glob) function to find files. If that is true then you may be able to order the two digit number after the one digit numbers using

```
path => ["/some/path/log.?", "/some/path/log.??", "/some/path/log.???"]
```

---

<div class="post-metadata">

**Author:** ![theirfan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theirfan/32/89339_2.png) [@theirfan](https://discuss.elastic.co/u/theirfan)\
**Post date:** [June 3, 2021, 2:52am UTC](https://discuss.elastic.co/t/logstash-read-file-in-what-order/274549/22 "2021-06-03T02:52:37Z")

</div>

> [@theirfan](#):
>
> i tried to use `exclude => "temp.log.10"` in the file input and seems to work properly, guess i have to make a way around to write another input in same config and parse that file.

I can work around with this one. Appreciate the advise on using Dir.Glob though.

---

<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 1, 2021, 2:53am UTC](https://discuss.elastic.co/t/logstash-read-file-in-what-order/274549/23 "2021-07-01T02:53:21Z")

</div>

Closed on July 1, 2021, 2:53am UTC

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

[Previous page](https://discuss.elastic.co/t/logstash-read-file-in-what-order/274549.md?page=1)
