Ensure the [Shared Drives][win-shareddrives] feature is enabled for the `C:` drive.
If you're using Docker for Windows, ensure the "Shared Drives" feature is enabled for the `C:` drive (Docker for Windows > Settings > Shared Drives). See [Configuring Docker for Windows Shared Drives](https://blogs.msdn.microsoft.com/stevelasker/2016/06/14/configuring-docker-for-windows-volumes/)(MSDN Blog).
#### macOS
The default Docker for Mac configuration allows mounting files from `/Users/`, `/Volumes/`, `/private/`, and `/tmp`
exclusively. Make sure the repository is cloned in one of those locations or follow the instructions from the
[documentation][mac-mounts] to add more locations.
## Usage
## Usage
### Bringing up the stack
### Bringing up the stack
**Note**: In case you switched branch or updated a base image - you may need to run `docker-compose build` first
Start the stack using Docker Compose:
Start the stack using `docker-compose`:
```console
```console
$ docker-compose up
$ docker-compose up
...
@@ -84,28 +103,50 @@ $ docker-compose up
...
@@ -84,28 +103,50 @@ $ docker-compose up
You can also run all services in the background (detached mode) by adding the `-d` flag to the above command.
You can also run all services in the background (detached mode) by adding the `-d` flag to the above command.
Give Kibana a few seconds to initialize, then access the Kibana web UI by hitting
> :information_source: You must run `docker-compose build` first whenever you switch branch or update a base image.
[http://localhost:5601](http://localhost:5601) with a web browser.
By default, the stack exposes the following ports:
If you are starting the stack for the very first time, please read the section below attentively.
* 5000: Logstash TCP input.
* 9200: Elasticsearch HTTP
* 9300: Elasticsearch TCP transport
* 5601: Kibana
**WARNING**: If you're using `boot2docker`, you must access it via the `boot2docker` IP address instead of `localhost`.
## Initial setup
**WARNING**: If you're using *Docker Toolbox*, you must access it via the `docker-machine` IP address instead of
### Setting up user authentication
`localhost`.
Now that the stack is running, you will want to inject some log entries. The shipped Logstash configuration allows you
> :information_source: Refer to [How to disable paid features](#how-to-disable-paid-features) to disable authentication.
to send content via TCP:
The stack is pre-configured with the following **privileged** bootstrap user:
* user: *elastic*
* password: *changeme*
Although all stack components work out-of-the-box with this user, we strongly recommend using the unprivileged [built-in
users][builtin-users] instead for increased security. Passwords for these users must be initialized:
```console
```console
$nc localhost 5000 < /path/to/logfile.log
$docker-compose exec-T elasticsearch 'bin/elasticsearch-setup-passwords' auto --batch
```
```
## Initial setup
Passwords for all 6 built-in users will be randomly generated. Take note of them and replace the `elastic` username with
`kibana` and `logstash_system` inside the Kibana and Logstash *pipeline* configuration files respectively. See the
[Configuration](#configuration) section below.
Restart Kibana and Logstash to apply the passwords you just wrote to the configuration files.
```console
$ docker-compose restart kibana logstash
```
Give Kibana a few seconds to initialize, then access the Kibana web UI by hitting
[http://localhost:5601](http://localhost:5601) with a web browser and use the following default credentials to login:
* user: *elastic*
* password: *\<your generated elastic password>*
Now that the stack is running, you can go ahead and inject some log entries. The shipped Logstash configuration allows
you to send content via TCP:
```console
$ nc localhost 5000 < /path/to/logfile.log
```
### Default Kibana index pattern creation
### Default Kibana index pattern creation
...
@@ -113,12 +154,11 @@ When Kibana launches for the first time, it is not configured with any index pat
...
@@ -113,12 +154,11 @@ When Kibana launches for the first time, it is not configured with any index pat
#### Via the Kibana web UI
#### Via the Kibana web UI
**NOTE**: You need to inject data into Logstash before being able to configure a Logstash index pattern via the Kibana web
> :information_source: You need to inject data into Logstash before being able to configure a Logstash index pattern via
UI. Then all you have to do is hit the *Create* button.
the Kibana web UI. Then all you have to do is hit the *Create* button.
Refer to [Connect Kibana with
Refer to [Connect Kibana with Elasticsearch][connect-kibana] for detailed instructions about the index pattern
Elasticsearch](https://www.elastic.co/guide/en/kibana/current/connect-to-elasticsearch.html) for detailed instructions
configuration.
about the index pattern configuration.
#### On the command line
#### On the command line
...
@@ -128,6 +168,7 @@ Create an index pattern via the Kibana API:
...
@@ -128,6 +168,7 @@ Create an index pattern via the Kibana API: