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.

circle-exclamation

To install the ELK, you will need:

  • Root permission on the server

  • GBDS installed on the server

circle-info

If you do not have the file, contact Griaule support team.

Then, follow the steps shown below.

  1. 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:

circle-info

Make sure to replace <host-ip> with the server's IP address.

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:

circle-info

Make sure to replace <host-ip> with the server's IP address.

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:

circle-info

Make sure to replace <hostname> to the server hostname. Keep the double quotes.

Next, look for the line that begins with #elasticsearch.hosts:. Uncomment the line and change its value to:

circle-info

Make sure to replace <elasticsearch-host-ip> to the IP address configured in Elasticsearch. Keep the double quotes.

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:

circle-info

Make sure to replace <hostname> with the server hostname.

Add the following content to the file, making the appropriate changes in server_name and proxy_pass:

circle-info

Make sure to replace <host-ip> to the server IP address and <kibana-host-ip> to the IP address of the server where Kibana is installed.

circle-exclamation

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:

circle-info

Make sure to replace <host-ip> with the server's IP address.

circle-check

Installing and Configuring Logstash

Install the Logstash package:

Then, install the MySQL Connector/J package:

circle-info

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:

circle-info

Make sure to replace <database-ip>, <database-username>, <database-password> and <elasticsearch-host-ip> with the appropriate values. Keep the double quotes.

circle-exclamation

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:

circle-info

The file may be located at /usr/lib/systemd/system/logstash.service.

Look for the line that begins with ExecStart=. Change its value from:

To:

Then, apply the changes by reloading the systemd configuration:

circle-exclamation

Then, enable the Logstash service to start automatically on machine boot:

Then, start the Logstash service:

And follow the log:

triangle-exclamation

Finally, to verify that Logstash created the index in Elasticsearch, run the following command:

circle-info

Make sure to replace <elasticsearch-host-ip> to the IP address of the server where Elasticsearch is installed.

The output should be similar to:

Configuring the ELK with SmartSense

Configuring Kibana

Creating the Data View

circle-info

Make sure to replace <kibana-host-ip> to the IP address of the server where Kibana is installed.

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 Pattern

  • Index pattern: smart_sense_index_pattern

  • Timestamp 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 stacked

  • Data view: SS Pattern

  • Horizontal Axis:

    • Functions: Date histogram

    • Field: load_time

  • Vertical Axis:

    • Functions: Sum

    • Field: 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 Dashboard

  • Tags: smartsense-enroll

Click Save and return.

Repeat the above operations to create the following dashboards:

circle-info

Adjust the names and tags as necessary.

  • For VERIFY add the filter: transaction_type is VERIFY

  • For UPDATE add the filter: transaction_type is UPDATE

  • For IDENTIFY add the filter: transaction_type is IDENTIFY and latent is false

  • For LATENT add the filter: transaction_type is IDENTIFY and latent is true

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?