# Templating an input plugin?

**URL:** <https://discuss.elastic.co/t/templating-an-input-plugin/354548>\
**Category:** Logstash\
**Created:** [March 1, 2024, 5:57pm UTC](https://discuss.elastic.co/t/templating-an-input-plugin/354548 "2024-03-01T17:57:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![learningelastic](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@learningelastic](https://discuss.elastic.co/u/learningelastic)\
**Post date:** [March 1, 2024, 5:57pm UTC](https://discuss.elastic.co/t/templating-an-input-plugin/354548/1 "2024-03-01T17:57:17Z")

</div>

I have a question about best practice. Let's say I have two files as follows:

File 1. `input.template.conf` with the content

```auto
input {
  elasticsearch {
    ... several lines of configuration ...
  }
}

```

File 2. `start-logstash.sh` with the content:

```auto
# each of the items in the confs array is a file with filter{} and output{}. It is only missing input{}
confs=("dmarc.conf" "sales-matchback.conf" "ga4-aggregation.conf" ... etc... )
for conf_file in "${confs[@]}"; do
  cat input.template.conf $conf_file > /etc/logstash/conf.d/$conf_file
done
# the next command will reference pipelines.yml and pipelines references all the configs in /etc/logstash/conf.d
/usr/share/logstash/bin/logstash 

```

Then to start logstash, i just run the command `./start-logstash.sh`

Is it better to avoid the `cat` command and use something like [Generating plugins | Logstash Reference [8.12] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugin-generator.html) ? Or is there something else I should consider all together?

---

<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, 2024, 5:57pm UTC](https://discuss.elastic.co/t/templating-an-input-plugin/354548/2 "2024-03-29T17:57:41Z")

</div>

Closed on March 29, 2024, 5:57pm UTC

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