# Variable content from file

**URL:** <https://discuss.elastic.co/t/variable-content-from-file/272296>\
**Category:** Logstash\
**Created:** [May 6, 2021, 12:50pm UTC](https://discuss.elastic.co/t/variable-content-from-file/272296 "2021-05-06T12:50:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![emilsvil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emilsvil/32/82426_2.png) [@emilsvil](https://discuss.elastic.co/u/emilsvil)\
**Post date:** [May 6, 2021, 12:50pm UTC](https://discuss.elastic.co/t/variable-content-from-file/272296/1 "2021-05-06T12:50:46Z")

</div>

Hi.  
Im using cidr filter to check if an IP si public or private.  
The list of cidrs to check is now hardcoded in the filter but I need to read it from a file or using a meta-variable loaded at runtime.

```
cidr {
                id => "netflow-postproc-cidr-dst_addr"
                address => ["%{[@metadata][netflow][dst_addr]}" ]
                network => ["0.0.0.0/32", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "fc00::/7", "127.0.0.0/8", "::1/128","169.254.0.0/16", "fe80::/10","224.0.0.0/4", "ff00::/8","255.255.255.255/32"]
                add_field => { "[@metadata][netflow][dst_locality]" => "private" }
            }

```

Something like this:

`cidr.yml => [@metadata][private_cidr]`

and then

`network => [@metadata][private_cidr]`

Is it possible?

Thanks

---

<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:** [June 3, 2021, 12:51pm UTC](https://discuss.elastic.co/t/variable-content-from-file/272296/2 "2021-06-03T12:51:40Z")

</div>

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