Hello, thanks for reaching out. What errors are you getting after you run mage. If you do not pass any arguments to mage it should print out the available build targets.
Which version of Go are you using? If you're building beats for a particular branch, you may want to check the .go-version file in the top directory of the beats repo to ensure the versions match.
Hello, I ran into something similar when I tested this on my Windows 10 laptop. On Linux and macOS, mage is build from source if it's needed. I didn't see the same behavior on Windows.
I downloaded the latest release of mage for Windows from the mage GitHub page:
I extracted the zip file and added the path to mage.exe to my Windows PATH. After mage.exe is in your path you should be able to do something like this.
cd $GOPATH\src\github.com\elastic\beats\filebeat
mage build
dir filebeat.exe
Thanks for your instruction Michael. After following it, I run make again. The following is what my cmd shows. Is it right? And how can I use metricbeat locally? What command should I input to start it?
I am pretty new here and asking a lot of details. Thanks for your patience.
I run mage build first, and matribeat -e as well. However, the metricbeat stopped accidentally. I really do not know why. The following is what I got. Thanks for your help.
I had similar results when I ran metricbeat -e on my Windows 10 laptop.
I think the following message is key. metricbeat may need to run as an administrator on Windows.
Can you try running metricbeat -e when PowerShell is running as Administrator?
2020-01-30T13:14:06.134-0600 WARN system/system_windows.go:27 Metricbeat is running without SeDebugPrivilege, a Windows privilege that allows it to collect metrics from other processes. The user running Metricbeat may not have the appropriate privileges or the security policy disallows it.
I believe I have a solution for the issue we were running into earlier with mage not being found on Windows.
To have mage automatically built/installed, you can run make.bat from the top level of the beats checkout. This should give you the version of mage that we test beats with.
PS C:\Users\mjm> cd .\go\src\github.com\elastic\beats
PS C:\Users\mjm\go\src\github.com\elastic\beats> .\make.bat
Please ensure %GOPATH%\bin in in your PATH after running make.bat.
If you pull the latest updates from the beats repo, do you see this issue? When I'd tried this earlier I was not seeing the metricset 'system/load' not found message.
PS C:\Users\mjm\go\src\github.com\elastic\beats\metricbeat> mage build 2020/02/04 10:20:03 Found Elastic Beats dir at C:\Users\mjm\go\src\github.com\elastic\beats
>> build: Building metricbeat
PS C:\Users\mjm\go\src\github.com\elastic\beats\metricbeat> .\metricbeat.exe Exiting: 1 error: metricset 'system/load' not found
Since you're building metricbeat from the master branch on WIndows, there's an additional step to adjust system.yml.
You'll need to comment out the line - load in modules.d/system.yml. It should look like this:
- module: system
period: 10s
metricsets:
- cpu
#- load
- memory
- network
- process
- process_summary
- socket_summary
#- entropy
#- core
#- diskio
#- socket
#- services
process.include_top_n:
by_cpu: 5 # include top 5 processes by CPU
by_memory: 5 # include top 5 processes by memory
After saving this update to system.yml, I was able to start metricbeat.
Can you run this with metricbeat.exe -e. You'll likely see much more information about the metricbeat start up process. Please let us know if you see any errors. At a minimum, you'll likely need to configure the output for metricbeat to point to an Elasticsearch instance.
Thanks Michael. I can see the detailed info right now. Thanks you for your patience in this period. Actually, what I am doing now still need to make it work on Linux (AWS Ubuntu). Do you know how to run source code under Linux? Do I still need to install mage?
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.