Creating beat from Metricbeat

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.

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

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

Hi Ruflin,

Thanks for the answer.

This is my code: https://github.com/fdmsantos/examplebeat

I add a new file with all commands I ran commands

Regards,
Fábio Santos

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 Perhaps you can adjust this part and get a cmd file into place? https://github.com/elastic/beats/blob/master/auditbeat/cmd/root.go

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.".FlagSet) as type *"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".Command) as type *"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

Hi again,

I'm really struggling here.

I created a new fresh beat based on metricbeat : 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

[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

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