{"id":45236,"date":"2026-11-25T22:08:25","date_gmt":"2026-11-25T22:08:25","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=45236"},"modified":"2026-11-25T22:08:25","modified_gmt":"2026-11-25T22:08:25","slug":"elastic-agent-commands-reference","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/elastic-agent-commands-reference\/","title":{"rendered":"Elastic Agent Commands Reference"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Elastic Agent runs as an operating system service, so you start and stop it with systemd on Linux, launchd on macOS and the Service Control Manager on Windows. This page adds what the start and stop commands above leave out: restart and status commands, enabling the agent at boot, the built-in <code>elastic-agent<\/code> CLI, install and uninstall commands, and fixes for common errors, including a corrected Windows command.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Start Elastic Agent<\/h2>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># Mac<\/span>\r\n$ sudo launchctl load \/Library\/LaunchDaemons\/co.elastic.elastic-agent.plist\r\n\r\n<span class=\"hljs-comment\"># Linux<\/span>\r\n$ sudo service elastic-agent start\r\n\r\n<span class=\"hljs-comment\">#Windows<\/span>\r\n$ Start-Service Elastic Agent\r\n\r\n<span class=\"hljs-comment\"># Debian<\/span>\r\n$ sudo systemctl start elastic-agent\r\n\r\n<span class=\"hljs-comment\">#RPM<\/span>\r\n$ sudo systemctl start elastic-agent\r\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Stop Elastic Agent<\/h2>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># Mac<\/span>\r\n$ sudo launchctl unload \/Library\/LaunchDaemons\/co.elastic.elastic-agent.plist\r\n\r\n<span class=\"hljs-comment\"># Linux<\/span>\r\n$ sudo service elastic-agent stop\r\n\r\n<span class=\"hljs-comment\">#Windows<\/span>\r\n$ Stop-Service Elastic Agent\r\n\r\n<span class=\"hljs-comment\"># Debian<\/span>\r\n$ sudo systemctl stop elastic-agent\r\n$ sudo service elastic-agent stop\r\n\r\n<span class=\"hljs-comment\">#RPM<\/span>\r\n$ sudo systemctl stop elastic-agent\r\n$ sudo service elastic-agent stop\r\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">How Elastic Agent runs on each platform<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Elastic Agent is one agent that replaces separately installed Beats such as Filebeat and Metricbeat. It manages its components (including Beats-based inputs) by itself, so day-to-day you control a single service. How it is installed decides where it lives and which commands apply:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Install method<\/th><th>Service manager<\/th><th>Service name<\/th><th>Install location<\/th><\/tr><\/thead><tbody><tr><td>Linux tar.gz + <code>elastic-agent install<\/code><\/td><td>systemd<\/td><td><code>elastic-agent<\/code><\/td><td><code>\/opt\/Elastic\/Agent<\/code><\/td><\/tr><tr><td>DEB or RPM package<\/td><td>systemd<\/td><td><code>elastic-agent<\/code><\/td><td><code>\/usr\/share\/elastic-agent<\/code>, config in <code>\/etc\/elastic-agent<\/code><\/td><\/tr><tr><td>macOS tar.gz + <code>elastic-agent install<\/code><\/td><td>launchd<\/td><td><code>co.elastic.elastic-agent<\/code><\/td><td><code>\/Library\/Elastic\/Agent<\/code><\/td><\/tr><tr><td>Windows zip\/MSI + install<\/td><td>Service Control Manager<\/td><td><code>Elastic Agent<\/code><\/td><td><code>C:\\Program Files\\Elastic\\Agent<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In the example above, the separate &quot;Linux&quot;, &quot;Debian&quot; and &quot;RPM&quot; entries all control the same systemd unit. On any modern systemd distribution, <code>sudo service elastic-agent start<\/code> just passes the request to <code>systemctl<\/code>. Use <code>systemctl<\/code> directly so you get clearer errors and status output.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Corrected start and stop commands<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Windows commands above fail as written. <code>Start-Service<\/code> takes the service name as a single positional argument. Without quotes, PowerShell reads <code>Elastic<\/code> and <code>Agent<\/code> as two arguments and stops with *A positional parameter cannot be found that accepts argument &#039;Agent&#039;*. Put the name in quotes and run the commands from an elevated (Run as Administrator) PowerShell window. The <code>$<\/code> prompt is also a Unix convention: PowerShell shows <code>PS&gt;<\/code>.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># Windows (elevated PowerShell)<\/span>\nPS&gt; Start-Service <span class=\"hljs-string\">\"Elastic Agent\"<\/span>\nPS&gt; Stop-Service <span class=\"hljs-string\">\"Elastic Agent\"<\/span>\nPS&gt; Restart-Service <span class=\"hljs-string\">\"Elastic Agent\"<\/span>\nPS&gt; Get-Service <span class=\"hljs-string\">\"Elastic Agent\"<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">On macOS, <code>launchctl load<\/code> and <code>unload<\/code> still work but are legacy subcommands. Current macOS releases use <code>bootstrap<\/code> and <code>bootout<\/code> with the <code>system<\/code> domain, and <code>kickstart<\/code> to restart:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># macOS: start (load the daemon)<\/span>\nsudo launchctl bootstrap system \/Library\/LaunchDaemons\/co.elastic.elastic-agent.plist\n\n<span class=\"hljs-comment\"># macOS: stop (unload the daemon)<\/span>\nsudo launchctl bootout system \/Library\/LaunchDaemons\/co.elastic.elastic-agent.plist\n\n<span class=\"hljs-comment\"># macOS: restart a loaded daemon<\/span>\nsudo launchctl kickstart -k system\/co.elastic.elastic-agent\n\n<span class=\"hljs-comment\"># macOS: check whether it is loaded and running<\/span>\nsudo launchctl <span class=\"hljs-keyword\">print<\/span> system\/co.elastic.elastic-agent | grep -E <span class=\"hljs-string\">'state|pid'<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Linux, for all install methods:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">sudo systemctl start elastic-agent\nsudo systemctl stop elastic-agent\nsudo systemctl restart elastic-agent\nsudo systemctl status elastic-agent<\/code><\/span><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Enable Elastic Agent at boot<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Running <code>elastic-agent install<\/code> from a tar.gz registers and enables the service for you. The DEB and RPM packages put the files in place but do not necessarily enable or start the service. After you enroll a package-installed agent, enable it explicitly:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">sudo systemctl enable --now elastic-agent\nsystemctl is-enabled elastic-agent   <span class=\"hljs-comment\"># expected: enabled<\/span>\nsystemctl is-active elastic-agent    <span class=\"hljs-comment\"># expected: active<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">On Windows the installer sets the service to start automatically. To check, or to fix it if someone changed it:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">PS&gt; Get-Service <span class=\"hljs-string\">\"Elastic Agent\"<\/span> | Select-<span class=\"hljs-built_in\">Object<\/span> Name, Status, StartType\nPS&gt; <span class=\"hljs-built_in\">Set<\/span>-Service <span class=\"hljs-string\">\"Elastic Agent\"<\/span> -StartupType Automatic<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Built-in elastic-agent CLI commands<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The service commands only start and stop the process. The <code>elastic-agent<\/code> binary talks to the running daemon and reports what it is actually doing. Run it as root or Administrator. For tar.gz installs the binary is also put on the PATH. If it is not found, call it by its full path inside the install directory.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Command<\/th><th>What it does<\/th><\/tr><\/thead><tbody><tr><td><code>elastic-agent status<\/code><\/td><td>Shows overall health, the Fleet connection and the state of each component and unit<\/td><\/tr><tr><td><code>elastic-agent status --output json<\/code><\/td><td>Same information in machine-readable form for scripts and monitoring<\/td><\/tr><tr><td><code>elastic-agent inspect<\/code><\/td><td>Prints the effective configuration the agent is running, including policy received from Fleet<\/td><\/tr><tr><td><code>elastic-agent diagnostics<\/code><\/td><td>Writes a zip archive of logs, configuration and state for troubleshooting or a support case<\/td><\/tr><tr><td><code>elastic-agent restart<\/code><\/td><td>Restarts the agent daemon without going through the service manager<\/td><\/tr><tr><td><code>elastic-agent version<\/code><\/td><td>Shows the binary version and, if reachable, the running daemon version<\/td><\/tr><tr><td><code>elastic-agent enroll<\/code><\/td><td>Enrolls an already installed agent into Fleet<\/td><\/tr><tr><td><code>elastic-agent upgrade &lt;version&gt;<\/code><\/td><td>Upgrades a standalone agent (Fleet-managed agents are upgraded from Fleet)<\/td><\/tr><tr><td><code>elastic-agent uninstall<\/code><\/td><td>Removes the service and the installed files<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># Quick health check on Linux or macOS<\/span>\nsudo elastic-agent status\n\n<span class=\"hljs-comment\"># Machine-readable status for scripts<\/span>\nsudo elastic-agent status --output json\n\n<span class=\"hljs-comment\"># Collect a diagnostics bundle in the current directory<\/span>\nsudo elastic-agent diagnostics<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> The JSON field names and the format of the state value have changed between releases. Check the output of your own version before you build alerting on it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install, enroll and uninstall<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Fleet-managed install from a tar.gz or zip archive. Copy the Fleet Server URL and enrollment token from <strong>Fleet &gt; Add agent<\/strong> in Kibana:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># Linux \/ macOS, from the extracted archive directory<\/span>\nsudo .\/elastic-agent install \\\n  --url=https:<span class=\"hljs-comment\">\/\/fleet-server.example.com:8220 \\<\/span>\n  --enrollment-token=&lt;ENROLLMENT_TOKEN&gt;\n\n<span class=\"hljs-comment\"># Windows, elevated PowerShell, from the extracted directory<\/span>\nPS&gt; .\\elastic-agent.exe install --url=https:<span class=\"hljs-comment\">\/\/fleet-server.example.com:8220 --enrollment-token=&lt;ENROLLMENT_TOKEN&gt;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Packages install first and enroll afterwards:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">sudo elastic-agent enroll \\\n  --url=https:<span class=\"hljs-comment\">\/\/fleet-server.example.com:8220 \\<\/span>\n  --enrollment-token=<span class=\"xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">ENROLLMENT_TOKEN<\/span>&gt;<\/span>\nsudo systemctl enable --now elastic-agent<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">To uninstall, use the method that matches the install. Archive installs use the agent&#039;s own uninstaller. Packages are removed with the package manager.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># Linux tar.gz install<\/span>\nsudo \/opt\/Elastic\/Agent\/elastic-agent uninstall\n\n<span class=\"hljs-comment\"># macOS<\/span>\nsudo \/Library\/Elastic\/Agent\/elastic-agent uninstall\n\n<span class=\"hljs-comment\"># Windows (elevated PowerShell)<\/span>\nPS&gt; &amp; <span class=\"hljs-string\">\"C:\\Program Files\\Elastic\\Agent\\elastic-agent.exe\"<\/span> uninstall\n\n<span class=\"hljs-comment\"># DEB \/ RPM<\/span>\nsudo apt-get remove elastic-agent      <span class=\"hljs-comment\"># Debian\/Ubuntu<\/span>\nsudo dnf remove elastic-agent          <span class=\"hljs-comment\"># RHEL\/Fedora family<\/span>\n\n<span class=\"hljs-comment\"># If the agent policy has tamper protection enabled<\/span>\nsudo \/opt\/Elastic\/Agent\/elastic-agent uninstall --uninstall-token &lt;TOKEN&gt;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Common errors and fixes<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Symptom<\/th><th>Likely cause<\/th><th>Fix<\/th><\/tr><\/thead><tbody><tr><td><code>Unit elastic-agent.service could not be found<\/code><\/td><td>The agent was run from the extracted archive but never installed as a service<\/td><td>Run <code>sudo .\/elastic-agent install ...<\/code> from the archive directory<\/td><\/tr><tr><td><code>A positional parameter cannot be found that accepts argument &#039;Agent&#039;<\/code><\/td><td>Service name not quoted in PowerShell<\/td><td>Use <code>Start-Service &quot;Elastic Agent&quot;<\/code><\/td><\/tr><tr><td>Access denied when controlling the service on Windows<\/td><td>PowerShell is not elevated<\/td><td>Reopen PowerShell with Run as Administrator<\/td><\/tr><tr><td><code>elastic-agent status<\/code> cannot connect to the daemon<\/td><td>The service is stopped or failed during startup<\/td><td>Start it, then check <code>sudo journalctl -u elastic-agent -n 100<\/code><\/td><\/tr><tr><td>Package-installed agent stops after a reboot<\/td><td>Service never enabled<\/td><td><code>sudo systemctl enable --now elastic-agent<\/code><\/td><\/tr><tr><td>Agent shows Offline or Unhealthy in Fleet<\/td><td>Service stopped, Fleet Server unreachable, or a failing integration<\/td><td>Run <code>elastic-agent status<\/code> locally and check network access to port 8220<\/td><\/tr><tr><td>Uninstall refused<\/td><td>Tamper protection is on in the agent policy<\/td><td>Get the uninstall token from Fleet and pass <code>--uninstall-token<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The agent writes detailed logs under its install directory, in a versioned <code>data\/elastic-agent-*\/logs<\/code> folder. On Linux, <code>journalctl -u elastic-agent<\/code> is most useful for failures that happen before the agent&#039;s own logging starts. When the cause is still unclear, <code>elastic-agent diagnostics<\/code> gathers these logs together with the running configuration.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Best practices<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use <code>systemctl<\/code>, <code>launchctl bootstrap\/bootout<\/code> and quoted PowerShell service names consistently in runbooks so commands are copy-paste safe.<\/li>\n\n\n<li>Check <code>elastic-agent status<\/code> after a restart. A running service does not mean that every integration is healthy.<\/li>\n\n\n<li>For Fleet-managed agents, change configuration in the agent policy in Kibana, not by editing <code>elastic-agent.yml<\/code> on the host. Local edits are overridden by the policy.<\/li>\n\n\n<li>Turn on tamper protection for endpoint security policies so local users cannot easily stop or remove the agent.<\/li>\n\n\n<li>Treat enrollment tokens as secrets. Do not commit them to repositories or leave them in shell history; pass them through your configuration management tool&#039;s secret store.<\/li>\n\n\n<li>Expect the host to appear offline in Fleet whenever you stop the service for maintenance, and tell whoever watches Fleet alerts.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For more on systemd service management and general server administration, see the <a href=\"https:\/\/www.devopsschool.com\/blog\/category\/operating-systems\/linux\/\">Linux tutorials<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">How do I check if Elastic Agent is running?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use <code>sudo systemctl status elastic-agent<\/code> on Linux, <code>Get-Service &quot;Elastic Agent&quot;<\/code> on Windows, or <code>sudo launchctl print system\/co.elastic.elastic-agent<\/code> on macOS. To check health as well as whether the process is running, run <code>sudo elastic-agent status<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I restart Elastic Agent?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run <code>sudo systemctl restart elastic-agent<\/code> on Linux, <code>Restart-Service &quot;Elastic Agent&quot;<\/code> in elevated PowerShell on Windows, or <code>sudo launchctl kickstart -k system\/co.elastic.elastic-agent<\/code> on macOS. The <code>elastic-agent restart<\/code> command also restarts the running daemon.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why does Start-Service Elastic Agent fail in PowerShell?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The service name contains a space, so PowerShell treats <code>Elastic<\/code> and <code>Agent<\/code> as two separate arguments. Put the name in quotes, <code>Start-Service &quot;Elastic Agent&quot;<\/code>, and run PowerShell as Administrator.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Where are Elastic Agent logs stored?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Logs are written under the install directory, for example <code>\/opt\/Elastic\/Agent<\/code> on Linux, in a versioned <code>data\/elastic-agent-*\/logs<\/code> folder. On Linux, <code>journalctl -u elastic-agent<\/code> shows service startup errors, and <code>elastic-agent diagnostics<\/code> collects all logs into a single archive.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Do I still need Filebeat or Metricbeat if I use Elastic Agent?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Usually not. Elastic Agent runs the needed data collection components itself, based on the integrations in its policy, so you manage one agent instead of several Beats.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related tutorials<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/category\/operating-systems\/linux\/\">More Linux tutorials<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/red-hat-ex342-complete-home-study-curriculum\/\">Red Hat EX342 Complete Home-Study Curriculum<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/how-to-login-to-linux-server-using-putty\/\">How to Login to Linux Server using Putty?<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Elastic Agent runs as an operating system service, so you start and stop it with systemd on Linux, launchd on macOS and the Service Control Manager on&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4957],"tags":[26269,5160],"class_list":["post-45236","post","type-post","status-publish","format-standard","hentry","category-linux","tag-beats","tag-systemd"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/45236","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=45236"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/45236\/revisions"}],"predecessor-version":[{"id":80246,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/45236\/revisions\/80246"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=45236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=45236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=45236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}