Basic Configuration

The software you downloaded comes with a sample configuration file named analytics.conf.example. You can remove the “.example” suffix and edit the file to your needs.

Config File Structure

See the sample configuration files for more details, here we just provide some basic information.

There is a number of sections in the file, each section is marked by its name put in the square brackets. Here are the sections:

Config File Location

Log Analytics looks for its configuration file in two folders:

The software checks these folders in the order provided above and looks for a file named .analytics.conf or analytics.conf there. If the file is found — it is parsed for the configuration options and no further search is made. If the file has errors – the software stops.

Specifying the Config Location

You can put the config file somewhere else and tell Log Analytics to use it instead using the -c or –config command line parameter:

./analytics -c ~/.config/analytics/config
analytics.exe --config d:\analytics\analytics.conf

Configuration Using Environment Variables

This is convenient if you are going to use Log Analytics in Docker or for some reasons don’t want to use the config file mentioned above.

Here is the list of environment variables the software reads:

Here’s how you can configure host and port using the environment variables:

WEB_HOST=localhost WEB_PORT=3000 ./analytics server

Configuration Using .env File

You can put the options above in a file named .env and put it right next to the Log Analytics executable. It will work exactly the same as if you set the environment variables directly.

Here is a sample .env file:

WEB_HOST=localhost
WEB_PORT=3000
LICENSE_COMMERCIAL=true

Once the configuration is complete, proceed to the Properties Creation Tutorial.