Creating New Beat based on MetricBeat

When I run the below binary, after running "make setup" and "make":

./mybeat -e -d "*"

I get the below error

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

Why it's looking for beat.yml? Should this be created manually? If so are there any docs where can i refer?

Due to various corporate policies, I can not share the code in public channels.

Hi @purus,

nice to hear you are creating a beat!

If you are adding a module, please consider adding it to upstream elastic/beats at metricbeat.
If you prefer to get your way your on the right path.

Can you take a look at the cmd/root.go file and check the contents of variable Name at that file? iirc the name of the metricbeat default config is taking from there.

Not sure if the generator you've used should've created a sample yaml config file, but you can copy the one you use at metricbeat stripping all non used parameters.

https://www.elastic.co/guide/en/beats/libbeat/current/config-file-format.html

Also, if you feel like you can tell us what the beat will do. We respect if you want to keep it secret :slight_smile:

cheers,
-- pablo

Thanks for your response.

I am actually extending MetricBeat. I am new to ELK too.

Where can I see the cmd/root.go? I created a new file beat.yml in the custom metric beat folder and it works.

But not sure if I have to creat the beat.yml file for every custom beat. I followed the steps based on the "Extending Metricbeat".

Sorry, I think I misunderstood.

If you are extending metricbeat you will be either adding a new set of metrics (metricset) to an existing module, or creating a new module if the system you want to monitor doesn't already exists here:

Either case, you fork the repo, and probably the first thing to do is building the binary without any modification to make sure your environment is set.

You will find a minimal metricbeat.yml file here https://github.com/elastic/beats/blob/master/metricbeat/metricbeat.yml. You can use for testing your generated binary.

Can you try to compile and run metricbeat without modifying anything yet?
If I'm understanding correctly you don't want a new beat, but extend current metricbeat functionality, in such case /mybeat shouldn't exist.

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