Using Elastic Stack to aid with your GSA replacement Planning

The Elastic Stack provides insights on how your users are searching.

Log analysis is the first step to planning your GSA replacement.

Why use Elastic Stack (ELK) in GSA replacement planning?

We have written previously on uses for the Elastic Stack. We often the first step and deciding where to go to look at where you’ve been. If you have watched any of our webinars regarding replacement strategies for your Google Search Appliance (GSA), you’ll know that we recommend analyzing your current GSA usage to determine how you are using your GSA. Knowing this will help you as you examine your existing use case to understand many aspects of what your replacement technology should do. Looking at the logs can provide an understanding of essential metrics:

Your query volume

At Peak (Queries Per Second [QPS])

Per month (Queries Per Month [QPM])

What returns zero results

Filter usage

Potentially where the users are performing the search

What results are being clicked on (If you are tracking clicks)

Query Intent

The process to do this is to download the logs from the GSA and then import them into a tool to analyze them. While these logs are t delimited, Excel is not the best tool because the log contains ‘packed’ fields that need to be parsed to be useful. Given our experience with the Elastic stack, our preference is to use ELK (Elastic, Logstash, and Kabana).

ELK is becoming the de facto analytic platform. You can spin up a stack on Google Cloud Platform in minutes, or if you are a little savvy, you can run it locally on your PC. MC+A does offer consulting services for ELK and Elastic. Contact our Professional Services team if you want to set up an environment of your own.

Since it’s high season for companies replacing their Google Search Appliances before they expire, we thought to share this guide to load and analyze those logs.

Get your logs into ELK

Step 1 – Installing ELK stack

First of all, we need to install ELK stack. For this purpose we recommend one of two approaches:

Install ELK locally

Spin up an Elastic cloud instance on Google Cloud Platform

Option 1 – Installing ELK Locally If you have homebrew, you can install Elastic, Logstash and Kibana via the command line:

If you goto www.elastic.co and sign up, you can get a 14-day trial instance.

Step 2 – Input Logs into Elastic

With an instance or cluster of ELK, we can start to push log data into it. These logs come from the GSA (Note: the GSA only stores the last 90 days of logs on the appliance). You can export these by individual collection or all logs. We recommend that you export all logs as we can filter on the site parameter.

Place all of the logs into a directory and note the location. Logstash, which will be used to feed the logs to Elastic, works only with a fully qualified path.

Configuring Logstash

Logstash has set of plugins for different types of inputs, outputs, and filters, which can read, parse and filter data according to your needs. The configuration of these plugins in Logstash can found in the configuration file (.conf extension).

Logstash Configuration file

A Logstash config file has a separate section for each type of plugin you want to add to the event processing pipeline. Each section contains the configuration options for one or more plugins. If you specify multiple filters, they are applied in the order of their appearance in the configuration file. For more information about the configuration file structure, click here. So, for our case, the configuration file that we would use to parse the logs will be this one:

We can see that the file contains the three sections Input, Filters and Output: Input section: Using the file plugin, in this section, we say to Logstash where is located the file that we want to parse (line 4, path => "/Users/user/gsa/logs/*.log”).

For more information about the others configurations click here.

Filter section: In this section, we parse the logs into useful fields for future Dashboards in Kibana. The plugins used here are:

– grok, used to parse an entire log entry, splitting it into fields like the client ip, serving time, bytes, etc. and the query search as a single string.

– kv, used to parse the query search into different parameters.

– date, used for matching the log’s date with the @timestamp in Kibana

– ruby, used for convert some field type into types more useful, for further visualizations in Kibana and also, used for split some of the resultant parameters from the kv plugin (Keyword, Searches, inmeta:, etc.)

– geoip, used to obtain the locations of the logs. To use the geoip plugin it’s necessary to do some additional steps, which we will detail in a separate blog, but the database and some information can be found here.

– mutate, in this case, is used to complement the geoip plugin.

Output section: We use the elasticsearch plugin for store logs in Elasticsearch, so this way we can use the Kibana Web interface. For more information about this plugin and others for the Output, section click here. Initializing the Pipeline Now that we have all the fundamentals, we can start logstash and send data$ /opt/logstash/bin/logstash -f /home/me/gsa.conf After that, the shell will print a lot of stuff meaning that the logs are being parsed and send it to Elasticsearch. We can see the parsed logs in Kibana, at http://localhost:5601/ by default.

Visualization of GSA logs in Kibana

Now that our data is indexed in Elasticsearch, we can look at the Kibana interface to get some useful analytics.

If we follow all the steps above, Kibana will be up and running at http://localhost:5601/. If we click on that link, we will probably see something like this.

This is because the date of the logs that we are working on, is from June to September; and for default, Kibana shows the data with a \@timestamp range of the last 15 minutes.

So, to see our logs, we will need to expand the time range to June-September, clicking the time picker (Last 15 minutes) and then the Absolute section. In this case, our time range is from June 9th to September 10th. If we click on “GO”, we would now able to see our data as a Histogram:

You can explore the data loaded, make sure that every field that you need was parsed correctly, etc. and then start creating some visualizations and making useful conclusions.

Visualizations

The visualize page is used to create new Visualizations based on new interactive search, a saved search or an existing saved visualization. Kibana allows you to create the following visualizations:

Area chart

Data table

Line chart

Markdown widget

Metric

Pie chart

Tile map

Vertical bar chart

This visualization can be saved, used individually, or can be used in Dashboards.We’ve made this easier for you. Request our starter kit which includes dozens of foundational visualizations.

Dashboards

The Dashboard page is used to show a collection of saved visualizations in different groups, under a Dashboard name. We’ve created three dashboards that are included in our starter kit.

First Name (required) Last Name (required) Your Email (required) Subject Your Message

Connect with US

MC+A Insights Newsletter

We use cookies to give you the best experience on our website. By continuing to browse the site, you are agreeing to our use of cookies. You can change your cookie settings at any time but if you do, you may lose some functionality. More information can be found in our Terms and Condition.OkRead more