使用 dmesg 来查看一些硬件或驱动程序的信息或问题。

logstash的Json格式数据中field多了个点 ,无法传递到es中。

Logstash | 作者 logstashHard | 发布于2017年07月25日 | 阅读数:3502

原始数据来源于RabbitMQ。
如下:
{
"host":{
"address":"192.168.127.1",
"port":9983,
"serviceName":"streamService2"
},
"spans":[
{
"begin":1500877798555,
"end":1500877798821,
"exportable":true,
"logs":[
{
"event":"sr",
"timestamp":1500877798557
},
{
"event":"ss",
"timestamp":1500877798821
}
],
"name":"http:/service1",
"parents":[777698211216806359],
"remote":true,
"spanId":4799424895103297227,
"traceId":777698211216806359
},
{
"begin":1500877798556,
"end":1500877798821,
"exportable":true,
"name":"http:/service1",
"parents":[4799424895103297227],
"spanId":-3738027106310948226,
"tags":{
"http.host":"localhost",
"http.method":"GET",
"http.path":"/service1",
"http.url":"http://localhost:9983/service1"
},
"traceId":777698211216806359
}
]
}
我在传递到es中时报错,说
"error"=>{"type"=>"mapper_parsing_exception", "reason"=>"Field name [http.host] cannot contain '.'"}}

我知道是字段中包含了 .  导致的,我是用rename结果无法进行重命名。请问各位怎么解决啊?
已邀请:

medcl - 今晚打老虎。

赞同来自: AlixMu logstashHard

es版本是多少呢?如果是2.0 - 2.3之间,默认是不允许的,新的5.x已经支持,如果你的是旧版本,参照下面的文档进行设置开启:
https://www.elastic.co/guide/e ... names

要回复问题请先登录注册