http://git-wip-us.apache.org/repos/asf/incubator-senssoft/blob/731fb44b/docker/logstash/Dockerfile ---------------------------------------------------------------------- diff --git a/docker/logstash/Dockerfile b/docker/logstash/Dockerfile index 3a9533a..d676e62 100644 --- a/docker/logstash/Dockerfile +++ b/docker/logstash/Dockerfile @@ -1,3 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + FROM logstash:5 MAINTAINER Michelle Beard <msbe...@apache.org>
http://git-wip-us.apache.org/repos/asf/incubator-senssoft/blob/731fb44b/docker/logstash/config/logstash-apache.conf ---------------------------------------------------------------------- diff --git a/docker/logstash/config/logstash-apache.conf b/docker/logstash/config/logstash-apache.conf deleted file mode 100644 index c95882b..0000000 --- a/docker/logstash/config/logstash-apache.conf +++ /dev/null @@ -1,82 +0,0 @@ -input { - # file { - # path => "/var/log/server_logs/access.log" - # start_position => "beginning" - # sincedb_path => "/dev/null" - # } - - file { - path => [ "/var/log/server_logs/access.log" ] - start_position => "beginning" - sincedb_path => "/dev/null" - type => "apache-access" - } - # file { - # path => "/var/log/server_logs/error.log" - # start_position => "beginning" - # sincedb_path => "/dev/null" - # type => "apache-error" - # } -} - -filter { - # ------------------------ Parse services logs into fields --------------------------- - # APACHE 2 - if [type] == "apache-access" { - # To process log data (message's content) using some regex or precompiled GROK pattern - grok { - match => [ "message", "%{COMBINEDAPACHELOG}"] - } - # To extract log's time according to a date pattern - date { - match => [ "timestamp", "dd/MMM/YYYY:HH:mm:ss Z"] - } - # Extract browser information, if available. - if [agent] != "" { - useragent { - source => "agent" - } - } - # Extract client ip information, if available. - # if [clientip] != "" { - # geoip { - # source => "clientip" - # database => "/usr/share/logstash/GeoIP/GeoIP.dat" - # target => "apache_clientip" - # add_tag => [ "geoip" ] - # } - # } - } - - # if [type] == "apache-error" { - # grok { - # match => [ "message", "%{APACHEERRORLOG}"] - # # Directory where to find the custom patterns - # patterns_dir => ["/etc/logstash/grok"] - # } - # if [clientip] != "" { - # geoip { - # source => "clientip" - # target => "apache_clientip" - # add_tag => [ "geoip" ] - # } - # } - # } -} - -output { - # Output data to Elasticsearch instance - elasticsearch { - hosts => "elasticsearch:9200" - index => "apache" - user => "elastic" - password => "changeme" - manage_template => true - template_overwrite => true - template => "/usr/share/logstash/templates/apache.json" - template_name => "apache" - } - - # Debug - stdout { codec => rubydebug } -} http://git-wip-us.apache.org/repos/asf/incubator-senssoft/blob/731fb44b/docker/logstash/config/logstash-userale.conf ---------------------------------------------------------------------- diff --git a/docker/logstash/config/logstash-userale.conf b/docker/logstash/config/logstash-userale.conf index 217a4dd..79a69d0 100644 --- a/docker/logstash/config/logstash-userale.conf +++ b/docker/logstash/config/logstash-userale.conf @@ -1,3 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + input { http { codec => "json" @@ -42,8 +57,6 @@ output { hosts => "elasticsearch:9200" index => "userale" document_type => "logs" - user => "elastic" - password => "changeme" manage_template => true template_overwrite => true template => "/usr/share/logstash/templates/userale.json" http://git-wip-us.apache.org/repos/asf/incubator-senssoft/blob/731fb44b/docker/logstash/templates/apache.json ---------------------------------------------------------------------- diff --git a/docker/logstash/templates/apache.json b/docker/logstash/templates/apache.json deleted file mode 100644 index 10552e3..0000000 --- a/docker/logstash/templates/apache.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "template": "apache", - "settings": { - "index.refresh_interval": "5s" - }, - "mappings": { - "_default_": { - "dynamic_templates": [{ - "string_fields": { - "match_mapping_type": "string", - "match": "*", - "mapping": { - "omit_norms": true, - "type": "text", - "fields": { - "raw": { - "ignore_above": 256, - "type": "keyword" - } - } - } - } - }], - "properties": { - "geoip": { - "dynamic": true, - "path": "full", - "properties": { - "location": { - "type": "geo_point" - } - }, - "type": "object" - }, - "@version": { - "type": "keyword" - }, - "referer": { - "type": "keyword" - }, - "request": { - "type": "keyword" - }, - "responsetime": { - "type": "long" - }, - "bytes": { - "type": "long" - } - }, - "_all": { - "enabled": true - } - } - }, - "aliases": { - - } -} http://git-wip-us.apache.org/repos/asf/incubator-senssoft/blob/731fb44b/docker/startup/Dockerfile ---------------------------------------------------------------------- diff --git a/docker/startup/Dockerfile b/docker/startup/Dockerfile new file mode 100644 index 0000000..ea8757d --- /dev/null +++ b/docker/startup/Dockerfile @@ -0,0 +1,29 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM ubuntu:latest +MAINTAINER Michelle Beard <msbe...@apache.org> + +RUN apt-get update && apt-get install -y wget curl && apt-get clean + +RUN wget https://github.com/jwilder/dockerize/releases/download/v0.1.0/dockerize-linux-amd64-v0.1.0.tar.gz + +RUN tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.1.0.tar.gz + +# Copy Files Over +COPY ./entrypoint.sh /opt/entrypoint.sh + +# Make executable +RUN chmod +x /opt/*.sh http://git-wip-us.apache.org/repos/asf/incubator-senssoft/blob/731fb44b/docker/startup/entrypoint.sh ---------------------------------------------------------------------- diff --git a/docker/startup/entrypoint.sh b/docker/startup/entrypoint.sh new file mode 100644 index 0000000..5686d9d --- /dev/null +++ b/docker/startup/entrypoint.sh @@ -0,0 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#!/bin/bash + +# Wait for the Elasticsearch container to be ready before starting Kibana. +echo "Stalling for Elasticsearch" +dockerize -wait http://elasticsearch:9200