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.

To install ELK you will need:

  • Root permission on the server

  • GBDS installed on the server

If you do not have the file, contact the Griaule Support Team at [email protected].

Then, follow the steps presented below.

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

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

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:

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

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:

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

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

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

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:

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

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

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

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:

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

Installing and Configuring Logstash

Install the Logstash package:

Next, install the MySQL Connector/J package:

If it is not found, download it at: https://dev.mysql.com/downloads/connector/j/

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:

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

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:

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

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

To:

Then, apply changes by reloading the systemd manager configuration:

Next, enable the Logstash service to start automatically on boot:

Then, start the Logstash service:

And follow the log:

Finally, to check if Logstash created the index in Elasticsearch, run the following command:

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

The output should be similar to:

Configuring ELK with SmartSense

Configuring Kibana

Creating the Data View

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

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 Pattern

  • Index pattern: smart_sense_index_pattern

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

  • Data view: SS Pattern

  • Horizontal Axis:

    • Functions: Date histogram

    • Field: load_time

  • Vertical Axis:

    • Functions: Sum

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

  • Tags: smartsense-enroll

Click on Save and return.

Repeat the above operations to create the following dashboards:

Adjust the names and tags as needed.

  • 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 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?