14

从 filebeat 索引日志时,我在 Elasticsearch 上遇到了 Mapper Parsing Error。

我尝试了 Filebeat -> Elasticserach 和 Filebeat -> Logstash -> Elasticsearch 方法。

我遵循了他们自己的文档,按照在 Elasticsearch 中加载索引模板的指示和验证安装了 filebeat 模板。文件节拍参考

我的 elasticsearch 通常可以与我的其他数据索引一起正常工作,我在 Kibana 上对其进行了测试。它是一个官方的 docker Docker Hub | 弹性搜索安装。

谷歌搜索了很多没有任何运气,因此,任何帮助表示赞赏。

更新 1:

ES 版本:2.3.3(我相信是最新的)

模板文件是 filebeat 附带的默认文件。

{
  "mappings": {
    "_default_": {
      "_all": {
        "norms": false
      },
      "dynamic_templates": [
        {
          "fields": {
            "mapping": {
              "ignore_above": 1024,
              "type": "keyword"
            },
            "match_mapping_type": "string",
            "path_match": "fields.*"
          }
        }
      ],
      "properties": {
        "@timestamp": {
          "type": "date"
        },
        "beat": {
          "properties": {
            "hostname": {
              "ignore_above": 1024,
              "type": "keyword"
            },
            "name": {
              "ignore_above": 1024,
              "type": "keyword"
            }
          }
        },
        "input_type": {
          "ignore_above": 1024,
          "type": "keyword"
        },
        "message": {
          "norms": false,
          "type": "text"
        },
        "offset": {
          "type": "long"
        },
        "source": {
          "ignore_above": 1024,
          "type": "keyword"
        },
        "type": {
          "ignore_above": 1024,
          "type": "keyword"
        }
      }
    }
  },
  "order": 0,
  "settings": {
    "index.refresh_interval": "5s"
  },
  "template": "filebeat-*"
}

更新2: 你是对的,见

#/usr/share/filebeat/bin/filebeat --version filebeat version 5.0.0-alpha2 (amd64), libbeat 5.0.0-alpha2

虽然这是将 apache 日志发布到 logstash。但是我无法以正确的格式获取此 vhost_combined 日志

sub1.example.com:443 1.9.202.41 - - [03/Jun/2016:06:58:17 +0000] "GET /notifications/pendingCount HTTP/1.1" 200 591 0 32165 "https://sub1.example.com/path/index?var=871190" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36"

"message" => "%{HOSTNAME:vhost}\:%{NUMBER:port} %{COMBINEDAPACHELOG}"

4

1 回答 1

22

您不能"type": "keyword"与 ES 2.3.3 一起使用,因为这是 ES 5 中的新数据类型(目前在 alpha3 中)

您需要将所有这些事件替换为

"type": "string",
"index": "not_analyzed"

你需要filebeat.template-es2x.json改用。

于 2016-06-03T05:31:41.700 回答