无法将logstash管道连接到elasticsearch

时间:2017-05-13 06:10:26

标签: elasticsearch logstash logstash-configuration

我的logstash管道是:

input {
    file {
        type => "foo"
        path => "/usr/share/logstash/logs/server.log"
        start_position => "beginning"
    }
}

output {
    elasticsearch {
        hosts => ["http://develk_es:9200"]
    }
}

它给出错误:

  

[2017-05-13T06:05:10,295] [错误] [logstash.agent]无法创建管道{:reason =>"方案http不接受注册表部分:develk_es:9200(或不好)主机名)"}

删除该管道并让logstash使用默认值,我可以成功访问es端点:

bash-4.2$ curl http://develk_es:9200
{
  "name" : "5HOR2_o",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "IUTpsvdGQoqDqZTEhZtWsw",
  "version" : {
    "number" : "5.4.0",
    "build_hash" : "780f8c4",
    "build_date" : "2017-04-28T17:43:27.229Z",
    "build_snapshot" : false,
    "lucene_version" : "6.5.0"
  },
  "tagline" : "You Know, for Search"
}

这是有意义的,因为他们都在同一个网络上:

$ docker network inspect netelk
[
    {
        "Name": "netelk",
        "Id": "bd5fdfda89bafd742b535974be8463a828bf6f7f0dbe0b9234be7147953fee1e",
        "Created": "2017-05-13T06:07:21.542334809Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.18.0.0/16",
                    "Gateway": "172.18.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Containers": {
            "01449553f056f70bc955fdd38970147ec1c6cff8afe7ba12ef4afcd02666290c": {
                "Name": "develk_ls",
                "EndpointID": "5c2b36ff64411560a9aeb63a4004c4e1b0c9f31eafb6b82e51967eac7f138ce9",
                "MacAddress": "02:42:ac:12:00:03",
                "IPv4Address": "172.18.0.3/16",
                "IPv6Address": ""
            },
            "e16b996ed1bb8e3f6082e3f0f83b8625a6ced801968dfd38e4a3753a60e98719": {
                "Name": "develk_es",
                "EndpointID": "a2ded2cc5988c3d9ee37ef8e0ffa2075fdaff5bb61b0e434552d20241b3b0515",
                "MacAddress": "02:42:ac:12:00:02",
                "IPv4Address": "172.18.0.2/16",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {}
    }
]

如何使logstash连接到ES?

0 个答案:

没有答案