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 Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
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
  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.

Daniel Berman user avatar by
Daniel Berman
·
Oct. 31, 16 · Tutorial
Like (7)
Save
Tweet
Share
32.05K 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.

Popular on DZone

  • Key Considerations When Implementing Virtual Kubernetes Clusters
  • Why It Is Important To Have an Ownership as a DevOps Engineer
  • Mind Map Reuse in Software Groups
  • Remote Debugging Dangers and Pitfalls

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: