Skip to content

Commit 99a6e09

Browse files
committed
Merge branch 'release/0.8.1'
2 parents b79150b + e48d51b commit 99a6e09

File tree

2 files changed

+52
-26
lines changed

2 files changed

+52
-26
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NAME = pblittle/docker-logstash
2-
VERSION = 0.8.0
2+
VERSION = 0.8.1
33

44
# Set the LOGSTASH_CONFIG_URL env var to your logstash.conf file.
55
# We will use our basic config if the value is empty.

README.md

Lines changed: 51 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,33 @@
22

33
This is a highly configurable logstash (1.4.2) image running elasticsearch (1.1.1) and Kibana 3 (3.0.1).
44

5-
## Optional first step, build image from source
5+
## Optional, build and run the image from source
66

7-
If you prefer to build from source rather than use the [pblittle/docker-logstash][1] trusted build published to the public Docker Registry, execute the following from the project root:
7+
If you prefer to build from source rather than use the [pblittle/docker-logstash][1] trusted build published to the public Docker Registry, execute the following:
88

9+
$ git clone https://github.com/pblittle/docker-logstash.git
10+
$ cd docker-logstash
911
$ make build
12+
$ make <options> run
13+
14+
See below for a complate example using `Vagrant`.
1015

1116
## Running Logstash
1217

13-
### First, choose an Elasticsearch configuration
18+
### First, prepare your Logstash configuration file
19+
20+
The logstash configuration file used in this container is downloaded from the internet using `wget`. The configuration file location is determined by the value of the `LOGSTASH_CONFIG_FILE` environment variable, which is set using the `-e` flag when executing `docker run`.
21+
22+
Unless `LOGSTASH_CONFIG_FILE` is overridden, an [example configuration file][2] for an embedded Elasticsearch will be downloaded, moved to `/opt/logstash.conf`, and used in your container.
23+
24+
I have created two reference config files that can be used for testing:
25+
26+
* [Embedded Elasticsearch server](https://gist.githubusercontent.com/pblittle/8778567/raw/logstash.conf) (default)
27+
* [Linked Elasticsearch container](https://gist.githubusercontent.com/pblittle/0b937485fa4a322ea9eb/raw/logstash_linked.conf)
28+
29+
You will find example usage using `-e LOGSTASH_CONFIG_URL=<your_logstash_config_url>` below.
30+
31+
### Second, choose an Elasticsearch install type
1432

1533
To run this logstash image, you have to first choose one of three Elasticsearch configurations.
1634

@@ -22,24 +40,31 @@ To run this logstash image, you have to first choose one of three Elasticsearch
2240

2341
To fetch and start a container running logstash and the embedded Elasticsearch server, simply execute:
2442

25-
$ docker run -d -p 9292:9292 -p 9200:9200 pblittle/docker-logstash
43+
$ docker run -d \
44+
-p 9292:9292 \
45+
-p 9200:9200 \
46+
pblittle/docker-logstash
2647

27-
Or, if you are working from the project source directory:
48+
If you want to use your own config file rather than the default, don't forget the `LOGSTASH_CONFIG_URL` environment variable as noted above:
2849

29-
$ make run
50+
$ docker run -d \
51+
-e LOGSTASH_CONFIG_URL=<your_logstash_config_url> \
52+
-p 9292:9292 \
53+
-p 9200:9200 \
54+
pblittle/docker-logstash
3055

3156
### Use a linked container running Elasticsearch
3257

33-
If you want to link to another container running elasticsearch rather than the embedded server, set the `ES_CONTAINER` environment variable to your existing elasticsearch container name.
34-
35-
$ docker run -d --link <your_es_container_name>:es -p 9292:9292 -p 9200:9200 pblittle/docker-logstash
58+
If you want to link to another container running elasticsearch rather than use the embedded server:
3659

37-
Or, if you are working from the project source directory:
60+
$ docker run -d \
61+
-e LOGSTASH_CONFIG_URL=<your_logstash_config_url> \
62+
--link <your_es_container_name>:es
63+
-p 9292:9292
64+
-p 9200:9200
65+
pblittle/docker-logstash
3866

39-
$ export ES_CONTAINER=<your_es_container_name>
40-
$ make run
41-
42-
In addition to the link, if you want your elasticsearch node's `bind_host` and `port` automatically detected, you will need to set the `ES_HOST` and `ES_PORT` placeholders in your `elasticsearch` definition in your logstash config file. For example:
67+
To have you the linked elasticsearch container's `bind_host` and `port` automatically detected, you will need to create an `ES_HOST` and `ES_PORT` placeholder in the `elasticsearch` definition in your logstash config file. For example:
4368

4469
output {
4570
elasticsearch {
@@ -48,22 +73,23 @@ In addition to the link, if you want your elasticsearch node's `bind_host` and `
4873
}
4974
}
5075

51-
### Use an external Elasticsearch server
76+
I have created an [example linked config file](https://gist.githubusercontent.com/pblittle/0b937485fa4a322ea9eb/raw/logstash_linked.conf) which includes the `ES_HOST` and `ES_PORT` placeholders described above.
5277

53-
If you are using an external elasticsearch server rather than an embedded or linked server, simply set the `ES_HOST` and `ES_PORT` environment variables.
78+
### Use an external Elasticsearch server
5479

55-
$ export ES_HOST=<your_es_server_host>
56-
$ export ES_PORT=<your_es_server_port>
57-
$ make run
80+
If you are using an external elasticsearch server rather than the embedded server or a linked container, simply provide a configuration file with the Elasticsearch endpoints already configured:
5881

59-
## Logstash configuration
82+
$ docker run -d \
83+
-e LOGSTASH_CONFIG_URL=<your_logstash_config_url> \
84+
-p 9292:9292
85+
-p 9200:9200
86+
pblittle/docker-logstash
6087

61-
Without any environment changes, an [example configuration file][2] will be created for you. You can override the example config by setting the `LOGSTASH_CONFIG_URL` environment variable to a file accessible via `wget`.
88+
### Finally, verify the installation
6289

63-
$ export LOGSTASH_CONFIG_URL=https://gist.github.com/pblittle/8778567/raw/logstash.conf
64-
$ make run
90+
You can now verify the logstash installation by visiting the prebuilt logstash dashboard:
6591

66-
This config file set by `LOGSTASH_CONFIG_URL` will be downloaded, moved to `/opt/logstash.conf`, and used in your container.
92+
http://<your_container_ip>:9292/index.html#/dashboard/file/logstash.json
6793

6894
## Test locally using Vagrant
6995

@@ -81,7 +107,7 @@ Start and provision a virtual machine using the provided Vagrantfile:
81107
From there, build and run a container using the newly created virtual machine:
82108

83109
$ make build
84-
$ make run
110+
$ make <options> run
85111

86112
You can now verify the logstash installation by visiting the [prebuilt logstash dashboard][3] running in the newly created container.
87113

0 commit comments

Comments
 (0)