# Creating beat from Metricbeat

**URL:** <https://discuss.elastic.co/t/creating-beat-from-metricbeat/160586>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [December 12, 2018, 4:50pm UTC](https://discuss.elastic.co/t/creating-beat-from-metricbeat/160586 "2018-12-12T16:50:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![fdmsantos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fdmsantos/32/44281_2.png) [@fdmsantos](https://discuss.elastic.co/u/fdmsantos)\
**Post date:** [December 12, 2018, 4:50pm UTC](https://discuss.elastic.co/t/creating-beat-from-metricbeat/160586/1 "2018-12-12T16:50:27Z")

</div>

Hello,

I'm trying to create a beat based on Metricbeat.

I have followed the steps described in

[https://www.elastic.co/guide/en/beats/devguide/current/creating-beat-from-metricbeat.html#creating-beat-from-metricbeat](https://www.elastic.co/guide/en/beats/devguide/current/creating-beat-from-metricbeat.html#creating-beat-from-metricbeat).

After doing make update command, the file examplebeat.yml was created (examplebeat is the name of my beat) but when i run the beat (after make command) i get the error:

**Exiting: error loading config file: stat beat.yml: no such file or directory**

Why the beat tried load beat.yml file and not examplebeat.yml?

Another question:

if I rename examplebeat.yml to beat.yml, I get another error:  
**Exiting: one or more modules must be configured**

Can you help me?

Regards,  
Fabio Santos

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [December 13, 2018, 8:31am UTC](https://discuss.elastic.co/t/creating-beat-from-metricbeat/160586/2 "2018-12-13T08:31:57Z")

</div>

Is your code somewhere on a public repo so I could have a quick look?

---

<div class="post-metadata">

**Author:** ![fdmsantos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fdmsantos/32/44281_2.png) [@fdmsantos](https://discuss.elastic.co/u/fdmsantos)\
**Post date:** [December 13, 2018, 10:15am UTC](https://discuss.elastic.co/t/creating-beat-from-metricbeat/160586/3 "2018-12-13T10:15:46Z")

</div>

Hi Ruflin,

Thanks for the answer.

This is my code: [https://github.com/fdmsantos/examplebeat](http://github)

I add a new file with all commands I ran [commands](https://github.com/fdmsantos/examplebeat/blob/master/commands.md)

Regards,  
Fábio Santos

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [December 14, 2018, 9:48am UTC](https://discuss.elastic.co/t/creating-beat-from-metricbeat/160586/4 "2018-12-14T09:48:06Z")

</div>

One think I spotted is that your main.go file looks a bit different then the one from auditbeat (which is also a metricbeat based Beat): [https://github.com/elastic/beats/blob/master/auditbeat/main.go](https://github.com/elastic/beats/blob/master/auditbeat/main.go) Perhaps you can adjust this part and get a cmd file into place? [https://github.com/elastic/beats/blob/master/auditbeat/cmd/root.go](https://github.com/elastic/beats/blob/master/auditbeat/cmd/root.go)

---

<div class="post-metadata">

**Author:** ![fdmsantos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fdmsantos/32/44281_2.png) [@fdmsantos](https://discuss.elastic.co/u/fdmsantos)\
**Post date:** [December 17, 2018, 11:14am UTC](https://discuss.elastic.co/t/creating-beat-from-metricbeat/160586/5 "2018-12-17T11:14:32Z")

</div>

Hi @ruflin,

Thanks for help.

I did changes, but I still got errors.

> cmd/root.go:49:45: cannot use runFlags (type \*"[GitHub - spf13/pflag: Drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.](http://github.com/spf13/pflag)".FlagSet) as type \*"[github.com/fdmsantos/examplebeat/vendor/github.com/elastic/beats/vendor/github.com/spf13/pflag](http://github.com/fdmsantos/examplebeat/vendor/github.com/elastic/beats/vendor/github.com/spf13/pflag)".FlagSet in argument to cmd.GenRootCmdWithRunFlags  
> cmd/root.go:50:20: cannot use ShowCmd (type \*"[GitHub - spf13/cobra: A Commander for modern Go CLI interactions](http://github.com/spf13/cobra)".Command) as type \*"[github.com/fdmsantos/examplebeat/vendor/github.com/elastic/beats/vendor/github.com/spf13/cobra](http://github.com/fdmsantos/examplebeat/vendor/github.com/elastic/beats/vendor/github.com/spf13/cobra)".Command in argument to RootCmd.Command.AddCommand

But I didn't understand. The main.go file and all files were created by following the steps from the documentation.

Why i need change them?

Regards,  
Fábio Santos

---

<div class="post-metadata">

**Author:** ![fdmsantos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fdmsantos/32/44281_2.png) [@fdmsantos](https://discuss.elastic.co/u/fdmsantos)\
**Post date:** [December 20, 2018, 5:57pm UTC](https://discuss.elastic.co/t/creating-beat-from-metricbeat/160586/6 "2018-12-20T17:57:43Z")

</div>

Hi again,

I'm really struggling here.

I created a new fresh beat based on metricbeat : [https://github.com/fdmsantos/vspherebeat](https://github.com/fdmsantos/vspherebeat)

I can't understand my problems.

I followed this documentation : [https://www.elastic.co/guide/en/beats/devguide/current/creating-beat-from-metricbeat.html](https://www.elastic.co/guide/en/beats/devguide/current/creating-beat-from-metricbeat.html)

```
[root@elk-ingress vspherebeat]# ./vspherebeat 
Exiting: error loading config file: stat beat.yml: no such file or directory
[root@elk-ingress vspherebeat]# 

```

Why the beat look to beat.yml file and not vspherebeat.yml?

The file vspherebeat.yml exists and was created by the command:

```
make update

```

I really apreciate any help.

Regards,  
Fabio Santos

---

<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:** [January 17, 2019, 6:02pm UTC](https://discuss.elastic.co/t/creating-beat-from-metricbeat/160586/7 "2019-01-17T18:02:20Z")

</div>

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