Skip to content
Snippets Groups Projects
Commit de80fcb9 authored by Kasper Marstal's avatar Kasper Marstal
Browse files

ENH: ELASTIX-1 Dockerized logstash forwarder

parent a881fe86
No related branches found
No related tags found
No related merge requests found
# ---------------------------------------------------------------------
# Settings
mark_as_advanced( ELASTIX_DASHBOARD_HOST )
set( ELASTIX_DASHBOARD_HOST "elastix" )
mark_as_advanced( ELASTIX_DASHBOARD_ELASTICSEARCH_PORT )
set( ELASTIX_DASHBOARD_ELASTICSEARCH_PORT 9200 )
mark_as_advanced( ELASTIX_DASHBOARD_LOGSTASH_PORT )
set( ELASTIX_DASHBOARD_LOGSTASH_PORT 5043 )
mark_as_advanced( ELASTIX_DASHBOARD_KIBANA_PORT )
set( ELASTIX_DASHBOARD_KIBANA_PORT 5601 )
# Dashboard configuration
mark_as_advanced( ELASTIX_DASHBOARD_SOURCE_DIR )
set( ELASTIX_DASHBOARD_SOURCE_DIR "${CMAKE_SOURCE_DIR}/Testing/Dashboard" )
......@@ -29,25 +18,33 @@ set( ELASTIX_DASHBOARD_VOLUME "${ELASTIX_DASHBOARD_BINARY_DIR}/Data" )
if( NOT EXISTS "${ELASTIX_DASHBOARD_VOLUME}" )
message( STATUS
"ELASTIX_DASHBOARD_VOLUME points to the default ${CMAKE_BINARY_DIR}/Testing/Dashboard/Data path in your build directory. Point to another directory on your local machine to ensure dashboard state is saved between builds."
"ELASTIX_DASHBOARD_VOLUME points to the default ${CMAKE_BINARY_DIR}/Testing/Dashboard/Data path in your build directory. In production you should point this variable to a safe directory outside the build tree."
)
file( MAKE_DIRECTORY "${ELASTIX_DASHBOARD_VOLUME}" )
endif()
# ---------------------------------------------------------------------
# Configure
# Test/Benchmark results will be forwarded to this IP. You will probably
# have change this in order to match docker settings on your own machine.
mark_as_advanced( ELASTIX_DASHBOARD_IP )
set( ELASTIX_DASHBOARD_IP "192.168.59.103" )
configure_file(
${ELASTIX_DASHBOARD_SOURCE_DIR}/elxDashboard.yml.in
${ELASTIX_DASHBOARD_BINARY_DIR}/elxDashboard.yml
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/docker-compose.yml.in
${ELASTIX_DASHBOARD_BINARY_DIR}/docker-compose.yml
${ELASTIX_DASHBOARD_SOURCE_DIR}/elxLogstashForwarder.yml.in
${ELASTIX_DASHBOARD_BINARY_DIR}/elxLogstashForwarder.yml
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/elxLogstash.conf.in
${ELASTIX_DASHBOARD_BINARY_DIR}/elxLogstash/elxLogstash.conf
${ELASTIX_DASHBOARD_SOURCE_DIR}/elxLogstash.conf.in
${ELASTIX_DASHBOARD_BINARY_DIR}/Logstash/elxLogstash.conf
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/elxLogstashForwarder.conf.in
${ELASTIX_DASHBOARD_BINARY_DIR}/elxLogstashForwarder.conf
${ELASTIX_DASHBOARD_SOURCE_DIR}/elxLogstashForwarder.json.in
${ELASTIX_DASHBOARD_BINARY_DIR}/elxLogstashForwarder.json
)
\ No newline at end of file
......@@ -2,7 +2,7 @@ elastix:
image: willdurand/elk
ports:
- "80:80"
- "@ELASTIX_DASHBOARD_LOGSTASH_PORT@:@ELASTIX_DASHBOARD_LOGSTASH_PORT@"
- "5043:5043"
volumes_from:
- data
......@@ -11,7 +11,4 @@ data:
volumes:
- @ELASTIX_DASHBOARD_SOURCE_DIR@:/etc/ssl
- @ELASTIX_DASHBOARD_VOLUME@:/data
- @ELASTIX_DASHBOARD_BINARY_DIR@/elxLogstash:/etc/logstash
\ No newline at end of file
- @ELASTIX_DASHBOARD_BINARY_DIR@/Logstash:/etc/logstash
input {
lumberjack {
port => @ELASTIX_DASHBOARD_LOGSTASH_PORT@
port => 5043
ssl_certificate => "/etc/ssl/@ELASTIX_DASHBOARD_LOGSTASH_CERTIFICATE@"
ssl_key => "/etc/ssl/@ELASTIX_DASHBOARD_LOGSTASH_RSA_PRIVATE_KEY@"
}
......
{
"network": {
"servers": [ "@ELASTIX_DASHBOARD_HOST@:@ELASTIX_DASHBOARD_LOGSTASH_PORT@" ],
"timeout": 15,
"ssl certificate": "@ELASTIX_DASHBOARD_SOURCE_DIR@/@ELASTIX_DASHBOARD_LOGSTASH_CERTIFICATE@",
"ssl key": "@ELASTIX_DASHBOARD_SOURCE_DIR@/@ELASTIX_DASHBOARD_LOGSTASH_RSA_PRIVATE_KEY@",
"ssl ca": "@ELASTIX_DASHBOARD_SOURCE_DIR@/@ELASTIX_DASHBOARD_LOGSTASH_CERTIFICATE@"
},
"files": [
{
"paths": [
"@CMAKE_BINARY_DIR@/Testing/Unit/*.xml"
],
"fields": {
"type": "unittest",
"lib": "elastix"
}
}
]
}
{
"network": {
"servers": [ "elastix:5043" ],
"timeout": 15,
"ssl certificate": "/etc/ssl/@ELASTIX_DASHBOARD_LOGSTASH_CERTIFICATE@",
"ssl key": "/etc/ssl/@ELASTIX_DASHBOARD_LOGSTASH_RSA_PRIVATE_KEY@",
"ssl ca": "/etc/ssl/@ELASTIX_DASHBOARD_LOGSTASH_CERTIFICATE@"
},
"files": [
{
"paths": [
"/var/unit/*.xml"
],
"fields": {
"type": "unittest",
"lib": "elastix"
}
},
{
"paths": [
"/var/benchmark/*.xml"
],
"fields": {
"type": "benchmark",
"lib": "elastix"
}
}
]
}
forwarder:
image: willdurand/logstash-forwarder
extra_hosts:
- "elastix:@ELASTIX_DASHBOARD_IP@"
volumes_from:
- data
data:
image: busybox
volumes:
- @ELASTIX_DASHBOARD_BINARY_DIR@/elxLogstashForwarder.json:/etc/logstash-forwarder/config.json
- @ELASTIX_DASHBOARD_SOURCE_DIR@:/etc/ssl
- @CMAKE_BINARY_DIR@/Testing/Unit:/var/unit
- @CMAKE_BINARY_DIR@/Testing/Benchmark:/var/benchmark
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment