Hi,
I am sending wmibeat to logstash and want to change the value of the field returned from string to number. I would normally do this with a mutate or grok in filter section, but I can't seem to get the field parsed correctly.
This is how it looks in Kibana:
wmi.Win32_Process.0.VirtualSize 35568685056
I thought this would work, but it doesn't:
filter {
mutate {
add_field => { "Bytes" => "%{[wmi][Win32_Process].0.[VirtualSize]}" }
convert => { "Bytes" => "float" }
}
}
The output from this is a new field called Bytes with the text above in it:
Bytes %{[wmi][Win32_Process].0.[VirtualSize]}
I have tried various formats of square brackets, using comma notation instead of square brackets, I even tried deciphering the ruby code, but I got completely lost with that. All I want is to convert the field content to a number instead of a string. What am I missing here?
I also run it with debug on and I can see the pipeline event as:
[DEBUG] 2018-10-30 18:23:59.356 [Ruby-0-Thread-10: :1] pipeline - filter received {"event"=>{"tags"=>["production", "fionatest", "wmibeat", "beat", "beats_input_raw_event"], "wmi"=>{"Win32_Process"=>{"0"=>{"Name"=>"filebeat.exe", "VirtualSize"=>"35568685056"}}}, "@timestamp"=>2018-10-30T18:23:54.943Z, "beat"=>{"name"=>"WIN-95VPU63HK0H", "hostname"=>"WIN-95VPU63HK0H"}, "type"=>"wmibeat", "host"=>"WIN-95VPU63HK0H", "@version"=>"1"}}