[英]Logstash JSON Parsing from RabbitMQ
I am getting the following Message from RabbitMQ, I think JSON received from RabbitMQ has BOM我从 RabbitMQ 收到以下消息,我认为从 RabbitMQ 收到的 JSON 有 BOM
{"ID":"811b7858-a926-479f-939a-2b0ab17de855","Name":"Johnson","Age": "30", "Work":"Engineer","Timestamp":"4/13/2015 10:53:29 AM"}
When i am saving that into Elastic search am getting it as below:当我将其保存到 Elastic 搜索中时,得到的结果如下:
{
"_index": "logstash-2015.04.13",
"_type": "logs",
"_id": "AUyxO4R8g98unoWRM4eU",
"_version": 1,
"_score": 1,
"_source": {
"message": "{"ID":"811b7858-a926-479f-939a-2b0ab17de855",","Name":"Johnson","Age": "30", "Work":"Engineer","Timestamp":"4/13/2015 10:53:29 AM"}",
"@version": "1",
"@timestamp": "2015-04-13T05:23:29.935Z",
"type": "Employees"
}
}
But i would like them to be stored as但我希望它们被存储为
{
"_index": "logstash-2015.04.13",
"_type": "logs",
"_id": "AUyxO4R8g98unoWRM4eU",
"_version": 1,
"_score": 1,
"_source": {
"ID":"811b7858-a926-479f-939a-2b0ab17de855",
"Name":"Johnson",
"Age": "30",
"Work":"Engineer",
"Timestamp":"4/13/2015 10:53:29 AM"
"@version": "1",
"@timestamp": "2015-04-13T05:23:29.935Z",
"type": "Employees"
}
}
I tried json filter.我试过json过滤器。 but it is not working.
但它不起作用。
You can try json filter for logstash which will convert message string to json format您可以尝试为 logstash 使用 json 过滤器,它将消息字符串转换为 json 格式
filter {
json {
source => "message"
remove_field => ["message"]
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.