Elastic Stack
Introduction
This manual describes the installation procedure for the Elastic Stack (ELK).
Preparation for Installation
This section covers the essential steps required for the installation.
To install the ELK, you will need:
Root permission on the server
GBDS installed on the server
Then, follow the steps shown below.
Log in to the server as root.
Prepare the Repository
To install the ELK, first the repository must be added to the server.
To do this, import the GPG key:
Create the repository file:
Add the following content to the file and save it:
Then, update the package manager cache. Start by cleaning the cache:
Finally, rebuild the package cache:
Installing the ELK
Installing and Configuring Elasticsearch
Install the Elasticsearch package:
Then, open the Elasticsearch configuration file:
In the Networksection, look for the line that begins with #network.host:. Uncomment the line and change its value to:
Next, turn off SSL by changing the following settings to false:
Then, start the Elasticsearch service:
And enable the Elasticsearch service to start automatically on machine boot:
Finally, check if the Elasticsearch service is running:
The result should be similar to:
Installing and Configuring Kibana
Install the Kibana package:
Then, open the Kibana configuration file:
Look for the line that begins with #server.host:. Uncomment the line and change its value to:
Next, look for the line that begins with #elasticsearch.hosts:. Uncomment the line and change its value to:
Then, start the Kibana service:
And enable the Kibana service to start automatically on machine boot:
Next, install and configure Nginx.
Installing and Configuring Nginx
Install the Nginx package:
Then, create a file that will contain the authentication credentials for Kibana. To do this, run the following command and enter the desired password when prompted:
Then, create a new configuration file for Nginx:
Add the following content to the file, making the appropriate changes in server_name and proxy_pass:
Test the Nginx configuration file:
Then, restart the Nginx service:
If necessary, configure the connection in SELinux:
Finally, verify that the Kibana service is running by accessing the following URL in a browser:
Installing and Configuring Logstash
Install the Logstash package:
Then, install the MySQL Connector/J package:
Then, create the Logstash configuration file:
Add the following content to the file, making the appropriate changes in jdbc_connection_string, jdbc_user, jdbc_password and hosts:
Next, the Logstash systemd file needs to be modified to ensure it is started using the configuration file created earlier. To do this, open the file:
Look for the line that begins with ExecStart=. Change its value from:
To:
Then, apply the changes by reloading the systemd configuration:
Then, enable the Logstash service to start automatically on machine boot:
Then, start the Logstash service:
And follow the log:
Finally, to verify that Logstash created the index in Elasticsearch, run the following command:
The output should be similar to:
Configuring the ELK with SmartSense
Configuring Kibana
Creating the Data View
In a browser, go to: http://<kibana-host-ip>:5601. Then, open the options sidebar by clicking this icon, located in the top left corner of the screen:

Click Management (last section). Then, in the options on the left side, in the Datesection, click Index Management.
Or access the following URL directly:
Make sure that the index smart_sense_index_pattern appears in the list.
Then, in the Kibana section of the left side options, click Data Views.
Click the blue Create data view button and fill in the fields with the following information:
Name:
SS PatternIndex pattern:
smart_sense_index_patternTimestamp field:
load_time
Confirm the creation of the Data View by clicking Save data view to Kibana.
Creating the Dashboards
Open the options sidebar again by clicking the icon in the top left corner of the screen. In the Analytics section, click Dashboards.
Or access the following URL directly:
Click the blue Create dashboard button. Then, click Create visualization. On the right side, configure the visualization with the following information:
Visualization type:
Vertical bar stackedData view:
SS PatternHorizontal Axis:
Functions:
Date histogramField:
load_time
Vertical Axis:
Functions:
SumField:
load_count
Then, click the + symbol, located in the top left corner of the screen, to create a new filter. Configure the filter with the following information: transaction_type is ENROLL. Confirm by clicking Add filter.
Finally, save the dashboard by clicking Save to library, located in the top right corner of the screen, and entering the following information:
Title:
SS Enroll DashboardTags:
smartsense-enroll
Click Save and return.
Repeat the above operations to create the following dashboards:
For VERIFY add the filter:
transaction_typeisVERIFYFor UPDATE add the filter:
transaction_typeisUPDATEFor IDENTIFY add the filter:
transaction_typeisIDENTIFYandlatentisfalseFor LATENT add the filter:
transaction_typeisIDENTIFYandlatentistrue
With the five dashboards created, enter each of them and set the time range to be displayed by clicking the calendar icon, located in the top right corner of the screen.
Then, click Share and Copy link. Save the link, as it will be used later.
Repeat the operation for the five dashboards.
At the end of each link, add the following information:
For example, the link:
Will become:
Repeat the operation for the five obtained links.
Save the links, as they will be used in the next step.
Configuring the Dashboards in SmartSense
Open the SmartSense configuration file, config.properties, located in the folder /var/lib/tomcats/smart-sense/conf:
Find the section # SMARTSENSE - ELK CONFIGURATION.
For each property (linkEnroll, linkIdentify, linkIdentifyLatent, linkUpdate, linkVerify), insert the link of the corresponding dashboard obtained earlier. For example:
Save and close the file.
After completing all the steps of the Elastic Stack installation procedure, go back to the SmartSense Server Configuration manual to finish the configuration.
Last updated
Was this helpful?

