# Having a cron job scheduler for file type input in logstash 5.0?

**URL:** <https://discuss.elastic.co/t/having-a-cron-job-scheduler-for-file-type-input-in-logstash-5-0/65441>\
**Category:** Logstash\
**Created:** [November 9, 2016, 7:07am UTC](https://discuss.elastic.co/t/having-a-cron-job-scheduler-for-file-type-input-in-logstash-5-0/65441 "2016-11-09T07:07:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kulasangar\_Gowrisang](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@Kulasangar\_Gowrisang](https://discuss.elastic.co/u/Kulasangar_Gowrisang)\
**Post date:** [November 9, 2016, 7:07am UTC](https://discuss.elastic.co/t/having-a-cron-job-scheduler-for-file-type-input-in-logstash-5-0/65441/1 "2016-11-09T07:07:14Z")

</div>

I'm having the `logstash` configuration where it picks up the log files from a folder and pushing it to the index.

This is how my `input` looks like:

```
  input {        
    	file {
    		path => "/home/chamith/work/ELK/sample_logs/gdcb_logs/GDCBAdapter_tdr.log*"
    		start_position => "beginning" 
    		ignore_older => 0 
    		sincedb_path => "/dev/null"
    	}
    }

```

I've tried cron `schedule` for `jdbc` input, but then I'm quite unsure of doing it for file types.

How can I have a scheduler in the above to check for any new log files or whether any new rows have been added to a log file time to time? Or does the `file` plugin do this automatically ?

Any help could be appreciated.

---

<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:** [November 9, 2016, 7:17am UTC](https://discuss.elastic.co/t/having-a-cron-job-scheduler-for-file-type-input-in-logstash-5-0/65441/2 "2016-11-09T07:17:52Z")

</div>

The file plugin does this by default. There are a couple of options that allows you to fine tune the behavior.

---

<div class="post-metadata">

**Author:** ![Kulasangar\_Gowrisang](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@Kulasangar\_Gowrisang](https://discuss.elastic.co/u/Kulasangar_Gowrisang)\
**Post date:** [November 9, 2016, 10:14am UTC](https://discuss.elastic.co/t/having-a-cron-job-scheduler-for-file-type-input-in-logstash-5-0/65441/3 "2016-11-09T10:14:00Z")

</div>

@magnusbaeck thanks 🙂

> [@magnusbaeck](#):
>
> There are a couple of options that allows you to fine tune the behavior.

What could be the options ?

---

<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:** [November 9, 2016, 10:16am UTC](https://discuss.elastic.co/t/having-a-cron-job-scheduler-for-file-type-input-in-logstash-5-0/65441/4 "2016-11-09T10:16:47Z")

</div>

> What could be the options ?

See the documentation.

---

<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:** [December 7, 2016, 10:16am UTC](https://discuss.elastic.co/t/having-a-cron-job-scheduler-for-file-type-input-in-logstash-5-0/65441/5 "2016-12-07T10:16:53Z")

</div>

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