version: "3"

services:
  elasticsearch:
    image: elasticsearch:2

  logstash:
    image: logstash:2
    command: |
      -e '
      input {
        gelf { }
        heartbeat { }
      }
      filter {
        ruby {
          code => "
            event.to_hash.keys.each { |k| event[ k.gsub('"'.'"','"'_'"') ] = event.remove(k) if k.include?'"'.'"' }
          "
        }
      }
      output {
        elasticsearch {
          hosts => ["elasticsearch:9200"]
        }
        stdout {
          codec => rubydebug
        }
      }'

    ports:
      - "12201:12201/udp"

  kibana:
    image: kibana:4
    ports:
      - "5601:5601"
    environment:
      ELASTICSEARCH_URL: http://elasticsearch:9200

