# Config.go don't react to any changes

**URL:** <https://discuss.elastic.co/t/config-go-dont-react-to-any-changes/147853>\
**Category:** Beats\
**Tags:** beats-development\
**Created:** [September 9, 2018, 11:07am UTC](https://discuss.elastic.co/t/config-go-dont-react-to-any-changes/147853 "2018-09-09T11:07:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmacew](https://avatars.discourse-cdn.com/v4/letter/k/b77776/32.png) [@kmacew](https://discuss.elastic.co/u/kmacew)\
**Post date:** [September 9, 2018, 11:07am UTC](https://discuss.elastic.co/t/config-go-dont-react-to-any-changes/147853/1 "2018-09-09T11:07:41Z")

</div>

Hi

I followed tutorial how to create your own beat ([https://www.elastic.co/guide/en/beats/devguide/current/new-beat.html](https://www.elastic.co/guide/en/beats/devguide/current/new-beat.html)). I found strange behavior, I might be doing something wrong, please correct me. I edited config/config.go and added string to struct:  
type Config struct {  
Period time.Duration `config:"period"`  
ProcessCommand string `config:"ProcessCommand"`  
}

var DefaultConfig = Config{  
Period: 1 \* time.Second,  
ProcessCommand: "ps aux",  
}

After that I added to \_meta/beat.yml:  
ProcessCommand: 'ps aux'  
Under my beat section.

After that I wanted to use it in my beater/xxx.go like:  
s := strings.Split(bt.config.ProcessCommand, ":::")

But It didn't work, I received message during build:  
beater/xxx.go:101:31: bt.config.ProcessCommand undefined (type config.Config has no field or method ProcessCommand)  
vendor/github.com/elastic/beats/libbeat/scripts/Makefile:99: recipe for target 'xxx' failed  
make: \*\*\* [sysusage] Error 2

What's intresting, I built this beat (for first time from tutorial) with default config.go where you have Path. After I deleted Path string from config struct in config.go I was able to build beat with:  
s := strings.Split(bt.config.Path, ":::")  
When the Path don't exist in config.go

I commented in config.go:  
Period: 1 \* time.Second  
It didn't affect build at all. It was still able to build without Path and Period in config.go. What am i doing wrong?

Regards,  
KM

---

<div class="post-metadata">

**Author:** ![kmacew](https://avatars.discourse-cdn.com/v4/letter/k/b77776/32.png) [@kmacew](https://discuss.elastic.co/u/kmacew)\
**Post date:** [September 9, 2018, 11:15am UTC](https://discuss.elastic.co/t/config-go-dont-react-to-any-changes/147853/2 "2018-09-09T11:15:39Z")

</div>

I found my mistake. I had wrong path in import {} to config.go. Sorry for trouble.

Regards,  
KM

---

<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:** [October 7, 2018, 1:15pm UTC](https://discuss.elastic.co/t/config-go-dont-react-to-any-changes/147853/3 "2018-10-07T13:15:49Z")

</div>

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