Elastic Stack
Introduction
This manual describes the installation procedures for the Elastic Stack (ELK).
Install Preparations
This section covers the essential steps required for the installation.
All steps must be performed with root privileges unless stated otherwise.
To install ELK you will need:
Root permission on the server
GBDS installed on the server
Then, follow the steps presented below.
Login to the server as root.
Prepare the Repository
To install ELK, you must first add the repository to the server.
To do so, import the GPG key:
Create the repository file:
Add the following content to the file and save it:
Then, update the cache of the packages manager. Start by cleaning the cache:
Finally, rebuild the package cache:
Installing ELK
Installing and Configuring Elasticsearch
Install the Elasticsearch package:
Then, open the Elasticsearch configuration file:
In the Network section, look for the line that starts with #network.host:. Uncomment it and change its value to:
Next, disable SSL by changing the following settings to false:
Then, start the Elasticsearch service:
And enable the Elasticsearch service to start automatically on boot:
Finally, check if the Elasticsearch service is running:
The output should be similar to:
Installing and Configuring Kibana
Install the Kibana package:
Then, open the Kibana configuration file:
Look for the line that starts with #server.host:. Uncomment it and change its value to:
Next, look for the line that starts with #elasticsearch.hosts:. Uncomment it and change its value to:
Then, start the Kibana service:
And enable the Kibana service to start automatically on boot:
Next, install and configure Nginx.
Installing and Configuring Nginx
Install the Nginx package:
Next, create a file that will contain the authentication credentials for Kibana. To do so, 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:
Below, the lines containing “^^^^^^^^^” are only present to highlight the changes that must be made. Remove them before saving the file.
Test the Nginx configuration file:
Then, restart the Nginx service:
If necessary, configure the connection in the SE:
Finally, check if the Kibana service is running, by accessing the following URL in a browser:
The username is kibanaadmin and the password is the one created above.
Installing and Configuring Logstash
Install the Logstash package:
Next, install the MySQL Connector/J package:
Then, create a new configuration file for Logstash:
Add the following content to the file, making the appropriate changes in jdbc_connection_string, jdbc_user, jdbc_password, and hosts:
Below, the lines containing “^^^^^^^^^” are only present to highlight the changes that must be made. Remove them before saving the file.
Next, the systemd file for Logstash needs to be modified to ensure it initializes using the previously created configuration file. To do so, open the file:
Look for the line that starts with ExecStart=. Change its value from:
To:
Then, apply changes by reloading the systemd manager configuration:
If installing in a new server that has an empty database, insert a dummy value in the smartsense.load_balancing_count table to avoid errors. To do so, run the following command and enter the database password:
Make sure to replace <database-username> and <mysql-database-ip> with the appropriate values.
Next, enable the Logstash service to start automatically on boot:
Then, start the Logstash service:
And follow the log:
If an error occurs indicating that Logstash cannot write to the directory /var/lib/logstash/{folder}, execute the following command to change its owner:
Finally, to check if Logstash created the index in Elasticsearch, run the following command:
The output should be similar to:
Configuring ELK with SmartSense
Configuring Kibana
Creating the Data View
In a browser, go to: http://<kibana-host-ip>:5601. Then, open the sidebar by clicking on this icon, located in the upper left corner of the screen:

Click on Management (last section). Then, in the options on the left side, in the Data section, click on Index Management.
Or go directly to the following URL:
Make sure that the smart_sense_index_pattern index appears in the list.
Next, in the Kibana section of the options on the left side, click on Data Views.
Click the blue button Create data view 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 on Save data view to Kibana.
Creating the Dashboards
Open the sidebar again by clicking the icon in the upper left corner of the screen. In the Analytics section, click on Dashboards.
Or go directly to the following URL:
Click the blue button Create dashboard. Then, click on Create visualization. On the right side, configure the visualization with the following information:
Visualization type:
Bar vertical stackedData view:
SS PatternHorizontal Axis:
Functions:
Date histogramField:
load_time
Vertical Axis:
Functions:
SumField:
load_count
Then, click on the + symbol, located in the upper left corner of the screen, to create a new filter. Configure the filter with the following information: transaction_type is ENROLL. Confirm by clicking on Add filter.
Finally, save the dashboard by clicking on Save to library, located in the upper right corner of the screen, and entering the following information:
Title:
SS Enroll DashboardTags:
smartsense-enroll
Click on 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 one and set the time range to be displayed by clicking on the calendar icon located in the upper right corner of the screen.
Next, click on Share and then on 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 on SmartSense
Open the the SmartSense configuration file, config.properties, located in the /var/lib/tomcats/smart-sense/conf folder:
Find the # SMARTSENSE - ELK CONFIGURATION section.
For each property (linkEnroll, linkIdentify, linkIdentifyLatent, linkUpdate, linkVerify), insert the corresponding dashboard link obtained earlier. For example:
Save and close the file.
After all steps in the Elastic Stack installation procedure are completed, refer back to the SmartSense Server Configuration manual to complete the configuration.
Last updated
Was this helpful?

