I understand there is a way to extend metric beats
but documentation is bit confusing it says there are two ways to extend
Extend Metricbeat directly
Create your own Beat and use Metricbeat as a library
what i understand is extending metricbeat directly is creating module and metricset under existing metric repo and start extending this new metric set
Create your own Beat is create a new beat with --type=metricbeat and start extending this new beat
but
when i fallow 1st method to direcltly extend metricbeat after creating
a metric set inside elastic/beat/metricbeat folder and enabled my module and tried to run i got and error Exiting: 1 error: 1 error: metricset 'micro/mic' is not registered, module not found
i don't really understand how to build using Create your own Beat and use Metricbeat as a library
generate a new beat by passing --type as metricbeat and it asks for metricset and module name
after this i compiled using make and executed using ./beatname -c myyml.yml i get error as Exiting: one or more modules must be configured
Let's focus on the second path (create your own beat and use metricbeat as a library) for now, since that is the recommended starting path. Can you share the contents of your myyml.yml here please?
issue was the name in .yml i created my beat named xyz and in .yml which i was using still had config pointing to metricbeat.config.modules: i dint find this anywhere in documentation that we need to change the name in .yml i just gave a try and it worked
but
i have one more issue with packaging if i do make package under my new beat i get make: Nothing to be done for 'package'.
ok further to this i downgraded beat to 6.2 and created new normal beat (without --type=metricbeat)
under new beat folder make setup was success and make package started buildinf triggering docker
and i created new beat with --type=metricbeat and did make setup go below error
cp: cannot stat 'module/*/_meta/kibana': No such file or directory vendor/github.com/elastic/beats/metricbeat/Makefile:23: recipe for target 'kibana' failed make[1]: [kibana] Error 1 (ignored) Traceback (most recent call last): File "./vendor/github.com/elastic/beats/script/generate_imports.py", line 7, in <module> from generate_imports_helper import comment, get_importable_lines ImportError: No module named generate_imports_helper vendor/github.com/elastic/beats/metricbeat/Makefile:57: recipe for target 'imports' failed make[1]: *** [imports] Error 1 make[1]: Leaving directory '/home/misra_debasish90/go/src/github.com/Manjukb/metrictest' Makefile:17: recipe for target 'setup' failed make: *** [setup] Error 2
The file /build/modules.d-win/system.yml isn't found. My guess is that some variable isn't set correctly. I suspect there will a file system.yml in <path to your module>/build/modules.d-win but the the sed program is looking in /build/modules.d-win and that's your root directory.
Is there a reason you are working off the 6.2 branch and not master or even the 6.x branch? The reason I ask is because the sed ... command for modules.d-win/system.yml seems to have been removed in 6.3 as part of a larger refactoring effort: https://github.com/elastic/beats/pull/7388.
Unless you have a very strong reason to develop off the 6.2 branch, I'd recommend working off master or 6.x.
pasting more details python --version = Python 2.7.13 go version = go version go1.10 linux/amd64 docker --version= Docker version 18.06.1-ce, build e68fc7a
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.