# Source a file from inside a logstash config pipeline?

**URL:** <https://discuss.elastic.co/t/source-a-file-from-inside-a-logstash-config-pipeline/254103>\
**Category:** Logstash\
**Created:** [November 3, 2020, 5:22am UTC](https://discuss.elastic.co/t/source-a-file-from-inside-a-logstash-config-pipeline/254103 "2020-11-03T05:22:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lamp123432](https://avatars.discourse-cdn.com/v4/letter/l/7993a0/32.png) [@lamp123432](https://discuss.elastic.co/u/lamp123432)\
**Post date:** [November 3, 2020, 5:22am UTC](https://discuss.elastic.co/t/source-a-file-from-inside-a-logstash-config-pipeline/254103/1 "2020-11-03T05:22:38Z")

</div>

Here's my logstash input config:

```auto
input {
        snmp {
                tables => [
                        { "name" => "interfaces" "columns" => [
                                ".1.3.6.1.2.1.31.1.1.1.1"
                        ] }
                ]
                hosts => [
                        { host => "udp:192.168.1.1/161" community => "public" },
                        { host => "udp:192.168.1.2/161" community => "public" }
                ]
        }
}

```

My list of hosts is dynamic, always updated... Can I source it from a file, something like that:

```auto
input {
        snmp {
                tables => [
                        { "name" => "interfaces" "columns" => [
                                ".1.3.6.1.2.1.31.1.1.1.1"
                        ] }
                ]
                hosts => [
                        source /path/to/host/file
                ]
        }
}

```

That would bring whatever is in the /path/to/host/file into the input config of logstash. If not, how can I dynamically generate my list?

---

<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 1, 2020, 5:22am UTC](https://discuss.elastic.co/t/source-a-file-from-inside-a-logstash-config-pipeline/254103/2 "2020-12-01T05:22:46Z")

</div>

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