我正在使用logstash / elasticsearch / kibana来控制某些应用程序日志。
我正在处理的应用程序是自定义开发,因此我必须定义我的模式/附加文件和我自己的elasticsearch映射。

我定义的映射是:

{
    "http-logs": {
        "properties": {
            "message": {
                "type": "string",
                "index": "no"
            },
            "@version": {
                "type": "long"
            },
            "@timestamp": {
                "type": "date"
            },
            "command": {
                "type": "string",
                "index": "not_analyzed"
            },
            "type": {
                "type": "string",
                "index": "analyzed"
            },
            "facade-in": {
                "type": "string",
                "index": "not_analyzed"
            },
            "facade-out": {
                "type": "string",
                "index": "not_analyzed"
            },
            "elapsed": {
                "type": "integer"
            },
            "items": {
                "type": "integer"
            }
        }
    }
}

并在ES上加载后,我可以看到它按预期定义:
...
“命令”:{
“type”:“string”,
“index”:“not_analyzed”
},
...

用logstash加载日志后,我试图可视化一些数据,但是由于我的字段引起的困扰,我感到困惑,因为kibana在说我的命令已被分析...。

我想念什么?

在此先感谢您的帮助。

最佳答案

如前所述,如果文档不匹配,here logstash将不依赖于您的映射。仔细检查我的对象和定义是否会导致问题,并清理映射/对象就可以解决问题。

09-10 06:05
查看更多