zoukankan      html  css  js  c++  java
  • ELK使用过程中遇到的一些问题

    filebeat

    背景:log组件有变动,应用发布到k8s上后,filebeat不收集了。

    排查过程

    $ k -n kube-system logs -f filebeat-cx6jp
    ...
    Configured paths: [/data/test/log/*.log]
    ...
    

    配置确实加载了,但是没有启动Harvester,也就是没有类似以下的记录

    Harvester started for file: /data/sync/test/abc.log
    

    但是不知道为什么没有。

    filebeat.yml中加入以下内容开启debug。(官方文档)

    logging.level: debug
    logging.to_stderr: true
    

    重启后发现以下内容:

    DEBUG	[input]	log/input.go:290   File /data/sync/test/abc.log skipped as it is a symlink.
    

    原来是因为/data/sync/test/abc.log是个软连,默认是不收集的。

    官网一番查找,加入了symlinks: true

    - type: log
         symlinks: true
         paths:
           - "/data/test/log/*.log"
    

    解决!

    The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true.

    {
        "error": {
            "root_cause": [
                {
                    "type": "illegal_argument_exception",
                    "reason": "The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true."
                }
            ],
            "type": "illegal_argument_exception",
            "reason": "The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true."
        },
        "status": 400
    }
    

    我用的是第二种,添加了include_type_name

    PUT _template/loges-pro-traefik?include_type_name
    
  • 相关阅读:
    小孩抓周
    psychology
    绝恋诗词
    一万小时定律
    王国维的人生三重境界
    2017年日历
    018 cisco 3560 MAC地址绑定
    017 SSH
    016 ppp authentication
    unity Tilemap
  • 原文地址:https://www.cnblogs.com/flhs/p/13634826.html
Copyright © 2011-2022 走看看