# Loading list of config parameters into custom beat

**URL:** <https://discuss.elastic.co/t/loading-list-of-config-parameters-into-custom-beat/185238>\
**Category:** Beats\
**Created:** [June 11, 2019, 4:04pm UTC](https://discuss.elastic.co/t/loading-list-of-config-parameters-into-custom-beat/185238 "2019-06-11T16:04:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dede\_Pessu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dede_pessu/32/44473_2.png) [@Dede\_Pessu](https://discuss.elastic.co/u/Dede_Pessu)\
**Post date:** [June 11, 2019, 4:04pm UTC](https://discuss.elastic.co/t/loading-list-of-config-parameters-into-custom-beat/185238/1 "2019-06-11T16:04:27Z")

</div>

Is there a way to load a multiple parameters into array/list type structure from your custom beat.yml file? all the custom beat tutorials only show loading one parameter into a singular variable

for example...

if you have this setup in your `custombeat.yml` file

```auto
<custombeat>:
  # Defines how often an event is sent to the output
  period: 1s

  queues:
    - name: test1
      group: group1
    - name: test2
      group: group2
    - name: test3
      group: group3

```

can you load it into your `config.go` file as an array to aceess the values of `queue` like so

```auto

type Config struct {
	Period time.Duration `config:"period"`
	Queues types.Array `config:"queues"'`
}

```

trying to access the values from the go code but doesn't seem to work  
is there another practical way to do this? thanks.

....  
similarly for the `lsbeat`

```auto
type Config struct {
	Period time.Duration `config:"period"`
	Path string `config:"path"`
}

```

```auto
lsbeat:
  # Defines how often an event is sent to the output
  period: 10s
  path: "."

```

this shows adding one path to "monitor", is it possible to make it a list of paths instead that can be inserted into the config file and interpreted by the go code for the lsbeat?

---

<div class="post-metadata">

**Author:** ![Dede\_Pessu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dede_pessu/32/44473_2.png) [@Dede\_Pessu](https://discuss.elastic.co/u/Dede_Pessu)\
**Post date:** [June 12, 2019, 1:17pm UTC](https://discuss.elastic.co/t/loading-list-of-config-parameters-into-custom-beat/185238/2 "2019-06-12T13:17:39Z")

</div>

Found a solution, you can simply use one of many yaml parsers provided by go to crawl through your yaml file and store the desired variables to an array or map. more information can be found here

[http://sweetohm.net/article/go-yaml-parsers.en.html](http://sweetohm.net/article/go-yaml-parsers.en.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:** [July 10, 2019, 3:17pm UTC](https://discuss.elastic.co/t/loading-list-of-config-parameters-into-custom-beat/185238/3 "2019-07-10T15:17:40Z")

</div>

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