Remove % from the field

Hi..
Below is the json output

{
"_index": "itrs-source-mantas2018-12-344",
"_type": "doc",
"_id": "AWeZyKeDpSGftotd3dLO",
"_version": 1,
"_score": null,
"_source": {
"operation": "update",
"@version": "1",
"data": {
"sampleTime": "2018-12-10T20:21:59.160Z",
"name": "Average_cpu",
"target": {
"filter": {
"osType": "Linux",
"pluginName": "CPU"
},
"sampler": "CPU",
"gateway": "MANTAS_ECS_GDCE",
"dataview": "CPU",
"managedEntity": "HKLPAPMTC02-7036",
"probe": "HKLPAPMTC02-7036",
"type": "Core_Linux"
},
"row": {
"percentIrq": "0.00 %",
"state": "",
"percentUtilisation": "2.81 %",
"percentSoftIrq": "0.07 %",
"clockSpeed": "",
"percentUserTime": "1.56 %",
"percentKernelTime": "0.94 %",
"percentIdle": "97.19 %",
"type": "",
"percentWaitTime": "0.25 %"
}
},
"@timestamp": "2018-12-10T20:22:02.894Z"
},
"fields": {
"@timestamp": [
1544473322894
],
"data.sampleTime": [
1544473319160
]
},
"highlight": {
"data.name.keyword": [
"@kibana-highlighted-field@Average_cpu@/kibana-highlighted-field@"
],
"data.name": [
"@kibana-highlighted-field@Average_cpu@/kibana-highlighted-field@"
]
},
"sort": [
1544473322894
]
}

I want to remove the % special character and convert the percentUtilisation as float.

I used the below logstash code.

filter {
mutate {
gsub => [ "[_source][data][row][percentUtilisation]", " \%", "" ]
convert => { "[_source][data][row][percentUtilisation]" => "float" }
}
}

but its not removing the % and coversion is not happening.

Please help..!!!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.