[id="{beatname_lc}-installation-configuration"]
== {beatname_uc} quick start: installation and configuration

++++
<titleabbrev>Quick start: installation and configuration</titleabbrev>
++++

This guide describes how to get started quickly with Windows log monitoring.
You'll learn how to:

* install {beatname_uc} on each system you want to monitor
* specify the location of your log files
* parse log data into fields and send it to {es}
* visualize the log data in {kib}

[role="screenshot"]
image::./images/winlogbeat-dashboard.png[{beatname_uc} dashboard]

[float]
=== Before you begin

You need {es} for storing and searching your data, and {kib} for visualizing and
managing it.

include::{libbeat-dir}/tab-widgets/spinup-stack-widget.asciidoc[]

[float]
[[installation]]
=== Step 1: Install {beatname_uc}

. Download the {beatname_uc} zip file from the
https://www.elastic.co/downloads/beats/winlogbeat[downloads page].
. Extract the contents into `C:\Program Files`.
. Rename the `winlogbeat-<version>` directory to `Winlogbeat`.
. Open a PowerShell prompt as an Administrator (right-click on the PowerShell
icon and select Run As Administrator).
. From the PowerShell prompt, run the following commands to install the service.

["source","sh",subs="attributes,callouts"]
----
PS C:\Users\Administrator> cd 'C:\Program Files\Winlogbeat'
PS C:\Program Files\Winlogbeat> .\install-service-winlogbeat.ps1

Security warning
Run only scripts that you trust. While scripts from the internet can be useful,
this script can potentially harm your computer. If you trust this script, use
the Unblock-File cmdlet to allow the script to run without this warning message.
Do you want to run C:\Program Files\Winlogbeat\install-service-winlogbeat.ps1?
[D] Do not run  [R] Run once  [S] Suspend  [?] Help (default is "D"): R

Status   Name               DisplayName
------   ----               -----------
Stopped  winlogbeat         winlogbeat
----

NOTE: If script execution is disabled on your system, you need to set the
execution policy for the current session to allow the script to run. For example:
`PowerShell.exe -ExecutionPolicy UnRestricted -File .\install-service-winlogbeat.ps1`.

[float]
[[set-connection]]
=== Step 2: Connect to the {stack}

include::{libbeat-dir}/shared/connecting-to-es.asciidoc[]

[float]
[[configuration]]
=== Step 3: Configure {beatname_uc}

In `winlogbeat.yml`, configure the event logs that you want to monitor.

. Under `winlogbeat.event_log`, specify a list of event logs to monitor. By
default, {beatname_uc} monitors application, security, and system logs.
+
[source,yaml]
----
winlogbeat.event_logs:
  - name: Application
  - name: Security
  - name: System
----
+
To obtain a list of available event logs, run `Get-EventLog *` in PowerShell.
For more information about this command, see the configuration details for
<<configuration-winlogbeat-options-event_logs-name,event_logs.name>>.

. (Optional) Set logging options to write Winlogbeat logs to a file:
+
[source,yaml]
----
logging.to_files: true
logging.files:
  path: C:\ProgramData\winlogbeat\Logs
logging.level: info
----

. After you save your configuration file, test it with the following command.
+
[source,shell]
----
PS C:\Program Files\Winlogbeat> .\winlogbeat.exe test config -c .\winlogbeat.yml -e
----


For more information about configuring {beatname_uc}, also see:

* <<configuring-howto-{beatname_lc},Configure {beatname_uc}>>
* {beats-ref}/config-file-format.html[Config file format]
ifeval::["{beatname_lc}"!="apm-server"]
* <<{beatname_lc}-reference-yml,+{beatname_lc}.reference.yml+>>: This reference configuration
file shows all non-deprecated options. You'll find it in the same location as
+{beatname_lc}.yml+.

[float]
[[setup-assets]]
=== Step 4: Set up assets

{beatname_uc} comes with predefined assets for parsing, indexing, and
visualizing your data. To load these assets:

. Make sure the user specified in +{beatname_lc}.yml+ is
<<privileges-to-setup-beats,authorized to set up {beatname_uc}>>.

. From the installation directory, run:
+
--
include::{libbeat-dir}/tab-widgets/setup.asciidoc[tag=win]
--

This step loads the recommended {ref}/indices-templates.html[index template] for writing to {es}
and deploys the sample dashboards for visualizing the data in {kib}.

[TIP]
=====
A connection to {es} (or {ess}) is required to set up the initial
environment. If you're using a different output, such as {ls}, see
<<load-template-manually>> and <<load-kibana-dashboards>>.
=====

[float]
[[start]]
=== Step 5: Start {beatname_uc}

Before starting {beatname_uc}, modify the user credentials in
+{beatname_lc}.yml+ and specify a user who is
<<privileges-to-publish-events,authorized to publish events>>.

To start the {beatname_uc} service, run:

// tag::start-step[]
[source,shell]
----------------------------------------------------------------------
PS C:\Program Files\Winlogbeat> Start-Service winlogbeat
----------------------------------------------------------------------

{beatname_uc} should now be running. If you used the logging configuration
described here, you can view the log file at
`C:\ProgramData\winlogbeat\Logs\winlogbeat`.

You can view the status of the service and control it from the Services
management console in Windows. To launch the management console, run
this command:

[source,shell]
----------------------------------------------------------------------
PS C:\Program Files\Winlogbeat> services.msc
----------------------------------------------------------------------
// end::start-step[]

[float]
==== Stop {beatname_uc}

Stop the {beatname_uc} service with the following command:

[source,shell]
----------------------------------------------------------------------
PS C:\Program Files\Winlogbeat> Stop-Service winlogbeat
----------------------------------------------------------------------

[float]
[[view-data]]
=== Step 6: View your data in {kib}

include::{libbeat-dir}/shared/opendashboards.asciidoc[tag=open-dashboards-intro]

include::{libbeat-dir}/shared/opendashboards.asciidoc[tag=open-dashboards]

[float]
=== What's next?

Now that you have your logs streaming into {es}, learn how to unify your logs,
metrics, uptime, and application performance data.

include::{libbeat-dir}/shared/obs-apps.asciidoc[]

// Add Javascript and CSS for tabbed panels
include::{libbeat-dir}/tab-widgets/code.asciidoc[]
