为Docker配置Logstash

时间:2017-11-22 11:20:20

标签: docker logstash docker-swarm

我是Docker的新手,我在使用Docker运行简单的logstash.conf时遇到问题。

我的Dockerfile:

FROM docker.elastic.co/logstash/logstash:5.0.0
RUN rm -f ~/desktop/docker_logstash/logstash.conf

Logstash.conf:

input {
    file {
        path => "~/desktop/filename.log"
        start_position => "beginning"
        sincedb_path => "/dev/null"
    }

}

filter {
    grok {
        match => {
            "message" => "%{COMBINEDAPACHELOG}"
        }
    }



}

output {
    stdout {
        codec => rubydebug
    }
}

Docker命令:

docker build -t logstashexample .
docker run logstashexample

我可以构建容器但是当我运行它时它会被卡住:

  

将Logstash日志发送到/ usr / share / logstash / logs,现在通过log4j2.properties配置。   [2017-11-22T11:08:23,040] [INFO] [logstash.inputs.beats]节拍输入:开始输入监听器{:address =>“0.0.0.0:5044”}   [2017-11-22T11:08:24,501] [INFO] [logstash.pipeline]起始管道{“id”=>“main”,“pipeline.workers”=> 1,“pipeline.batch.size”= > 125,“pipeline.batch.delay”=> 5,“pipeline.max_inflight”=> 125}   [2017-11-22T11:08:24,520] [INFO] [logstash.pipeline]管道主要开始[2017-11-22T11:08:24,593] [INFO] [org.logstash.beats.Server]在端口上启动服务器: 5044   [2017-11-22T11:08:25,054] [INFO] [logstash.agent]已成功启动Logstash API端点{:port => 9600}

我做错了什么?感谢。

0 个答案:

没有答案