# How to use includes in Logstash conf files

**URL:** https://discuss.elastic.co/t/how-to-use-includes-in-logstash-conf-files/204283
**Category:** Logstash
**Created:** [October 18, 2019, 9:57pm UTC](https://discuss.elastic.co/t/how-to-use-includes-in-logstash-conf-files/204283 "2019-10-18T21:57:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kmiklas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kmiklas/32/50730_2.png) [@kmiklas](https://discuss.elastic.co/u/kmiklas)
#### Post date: [October 18, 2019, 9:57pm UTC](https://discuss.elastic.co/t/how-to-use-includes-in-logstash-conf-files/204283/1 "2019-10-18T21:57:28Z")

</div>

Can includes be used in logstash config files?

**Minimal, Complete, and Verifiable Example**

Can I replace this...

_file: beats.conf_

```
input {
  beats {
    port => 5044
  }
}
filter {
    date {
        match => ["myTimestamp", "yyyyMMdd_HH:mm:ss.SSS"]
        target => "date_time"
    }
}
output {
  elasticsearch {
    hosts => ["localhost:9200"]
  }
}

```

...with this?

_file: date.inc_

```
date {
    match => ["myTimestamp", "yyyyMMdd_HH:mm:ss.SSS"]
    target => "date_time"
}

```

_file: beats.conf_

```
input {
  beats {
    port => 5044
  }
}
filter {
    #include <date.inc> // <- THIS THIS THIS THIS THIS
}
output {
  elasticsearch {
    hosts => ["localhost:9200"]
  }
}
```

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [October 19, 2019, 8:09am UTC](https://discuss.elastic.co/t/how-to-use-includes-in-logstash-conf-files/204283/2 "2019-10-19T08:09:01Z")

</div>

There is no concept of include files in Logstash so I am not sure where you got that from. If you read config from a directory you can split config into multiple files that are concatenated, but you there has to specify full blocks. You can also organize your config into [multiple distinct pipelines](https://www.elastic.co/guide/en/logstash/7.4/multiple-pipelines.html) which you can[send data between](https://www.elastic.co/guide/en/logstash/7.4/pipeline-to-pipeline.html).

---

<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: [November 16, 2019, 8:10am UTC](https://discuss.elastic.co/t/how-to-use-includes-in-logstash-conf-files/204283/3 "2019-11-16T08:10:26Z")

</div>

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