Hi all. I have a event like:
{"@timestamp":"2016-04-03T08:17:15.202Z","host":"shifudao","type":"rtds","loglevel":"WARN","classname":"hawkeyes.rtds.gate.protocol.frametype.SamplerReportData","logdetail":{"message":"设备00000068数据上报帧里的sid为空,可能未发过心跳,丢弃!","action":"fireEquipmentDataArrived(String writeHandlerID, String sid, Vertx vertx, List result)","sid":null,"params":{"writeHandlerID":"f7d2f035-b90f-4d2d-b9b4-d44a59f0227d","sid":null,"result":[{"eId":"00000068","date":1459672746202,"items":[[4,[26,17,0,0]],[5,[0,0,0,0]],[6,[-4,-1,0,0]],[7,[28,38,0,0]],[8,[-33,0,0,0]],[9,[-65,0,0,0]],[10,[0,0,0,0]],[11,[-52,0,0,0]],[12,[-65,0,0,0]],[32,[0,0,0,0]],[33,[0,0,0,0]],[35,[0,0,0,0]],[38,[-1,0,0,0]],[39,[0,0,0,0]],[40,[0,0,0,0]],[41,[0,0,0,0]],[42,[0,0,0,0]],[43,[0,0,0,0]],[44,[0,0,0,0]],[45,[0,0,0,0]],[48,[34,-55,0,0]],[49,[-36,-65,0,0]],[50,[-36,86,0,0]]]}]}},"@version":"1"}
And here is the rubydebug
output:
{
"@timestamp" => 2016-04-03T08:17:15.202Z,
... SNIP ...
"logdetail" => {
... SNIP ...
"params" => {
"writeHandlerID" => "f7d2f035-b90f-4d2d-b9b4-d44a59f0227d",
"sid" => nil,
"result" => [
[0] {
"eId" => "00000068",
"date" => 1459672746202,
"items" => [
[ 0] [
[0] 4,
[1] [
[0] 26,
[1] 17,
[2] 0,
[3] 0
]
],
[ 1] [
... SNIP ...
"@version" => "1"
}
Now I want to convert the logdetail.params
filed to string
, how to ?
I've tried:
filter {
ruby {
code => "
event['logdetail']['params'] = event['logdetail']['params'].to_s
"
}
}
But nothing happens.