DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Related

  • Building a Cost-Effective ELK Stack for Centralized Logging
  • Cluster Logging of Telecom 5G IOT Microservice Pods
  • Host Hack Attempt Detection Using ELK
  • Top 7 Cross Browser Testing Tools in 2021

Trending

  • From ETL to ELT to Real-Time: Modern Data Engineering with Databricks Lakehouse
  • How to Install and Set Up Jenkins With Docker Compose
  • Innovation at Speed: How Cloud-Native Development Accelerates Time-to-Market
  • Java Enterprise Matters: Why It All Comes Back to Jakarta EE
  1. DZone
  2. Data Engineering
  3. Big Data
  4. Installing the ELK Stack on Windows

Installing the ELK Stack on Windows

This article will guide you through the necessary steps to install the ELK Stack’s components as Windows services.

By 
Daniel Berman user avatar
Daniel Berman
·
Updated Oct. 31, 16 · Tutorial
Likes (7)
Comment
Save
Tweet
Share
34.4K Views

Join the DZone community and get the full member experience.

Join For Free

featured-image

windows? elk? well, while it would be safe to assume that most elk stack deployments are on linux-based systems, there are certain use cases in which you would want to install the stack on a windows machine.

if you’re looking to log windows event logs , for example, and you do not want to ship the logs over the web to an elk server for security reasons, you’re going to want to deploy the stack locally.

this article will guide you through the necessary steps to install the elk stack’s components as windows services. note: this example will use elasticsearch, 2.3.5, logstash 2.3.4, and kibana 4.5.4.

the setup

i’ll be using a windows 2012 r2 instance on amazon web services. the operating system is just a basic server 2012 r2 installation — but with updates and a disabled firewall. i’ve also installed an apache server for the purpose of demonstrating how to log into elk.

elasticsearch and logstash require java, so you will also need to download and install it — jdk and not jre — and create a java_home system variable as well.

adding java system variable

installing elasticsearch

our first step is to install elasticsearch — the heart of the stack, if you like, that is responsible for storing and indexing the log data.

you can download the latest version of elasticsearch from elastic’s elasticsearch download page . extract the downloaded package into a designated folder in your file system (e.g. c:\elk ).

next, open a powershell prompt and enter the following command (be sure to enter your installation path in the command):

$ invoke-expression -command “c:\elk\elasticsearch\bin\service install”


you should get an output that looks as follows:

installing service      :  "elasticsearch-service-x64"
using java_home (64-bit):  "c:\program files\java\jdk1.8.0_1
the service 'elasticsearch-service-x64' has been installed.


next, we’re going to open the service manager for the elasticsearch service:

$ invoke-expression -command “c:\elk\elasticsearch\bin\service manager”


service manager for elasticsearch

this is where you customize settings for elasticsearch. memory for jvm, for example, can be configured on the java tab, which is important for when you start to ingest large quantities of data.

on the general tab, we’re going to select the “automatic” startup type and hit the “start” button to start elasticsearch. to make sure that all is running as expected, enter the following url into your browser:

http://localhost:9200


you should get the following output:

{
    "name" : "andrew chord",
    "cluster_name" : "elasticsearch",
    "version" : {
        "number" : "2.3.5",
        "build_hash" : "90f439ff60a3c0f497f91663701e64ccd01edbb4",
        "build_timestamp" : "2016-07-27t10:36:52z",
        "build_snapshot" : false,
        "lucene_version" : "5.5.0"
    },
    "tagline" : "you know, for search"
}


installing logstash

next up is logstash . now, there are a number of ways to install logstash on windows, but it cannot be installed as a service out-of-the-box. so, i’ll be using a service manager called non-sucking service manager ( nssm ), which i have downloaded and extracted into the folder that contains all of our installed elk packages.

now, download and extract logstash from the logstash download page to the same folder.

before installing logstash nssm, create a logstash configuration file called “ config.json ” and place it in the “ bin ” directory.

next, enter the following command in powershell (be sure to update the paths invoked):

$ invoke-expression -command “c:\elk\nssm\win64\nssm install logstash”


you should see the nssm dialog:

nssm service installer for logstash

for the application path, browse to and select the logstash .bat file. the “startup” directory field below is completed automatically. in the “arguments” field, enter:

-f c:\elk\logstash\bin\config.json


there are other options you can configure such as tying the service to elasticsearch, but for the purpose of this guide, these settings will suffice.

click the “install service” button and a success message will be displayed. in powershell, you will see the following message:

service "logstash" installed successfully!


logstash service installed successfully message

open windows task manager and start the service from the “services” tab.

installing kibana

as with logstash, we will install kibana as a windows service using nssm. download and extract kibana from the kibana download page .

use this command in powershell to create the service:

$ invoke-expression -command “c:\elk\nssm\win64\nssm install kibana”


in the nssm dialog, complete the relevant paths to the kibana files (there is no need to pass any arguments for kibana) and click “install service”:

service "kibana" installed successfully!


as with logstash, start the service from your task manager — you should now have all three services up and running!

service manager - up and running!

to verify, open your browser at this address: http://127.0.0.1:5601 .

kibana open in browser

congrats! you’ve successfully installed the elk stack on your windows server!

as you may notice — kibana is notifying you that it could not fetch mapping. this is because you have not shipped any data yet. this is, of course, the next step. if you’re trying to set up a pipeline of windows event logs into elk, i described how to install and use winlogbeat (a log shipper by elastic for shipping event logs into elk) in this additional guide to windows event log analysis .

Web Service operating system Elasticsearch Kibana

Published at DZone with permission of Daniel Berman, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Building a Cost-Effective ELK Stack for Centralized Logging
  • Cluster Logging of Telecom 5G IOT Microservice Pods
  • Host Hack Attempt Detection Using ELK
  • Top 7 Cross Browser Testing Tools in 2021

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • [email protected]

Let's be friends: