Ruby hash to fields of an event

Hi I got the following ruby hash after parsing a long string with ruby code,

 { "mfemve"=>"0,39 ", "vmtoolsd"=>"0,39 ", "zabbix_agentd"=>"0,39 ", "powershell"=>"0,39 ", "ir_agent"=>"0,00 ", "wmiprvse"=>"0,00 ", "unsecapp"=>"0,00 ", "ccmexec"=>"0,00 ", "searchindexer"=>"0,00 "}

now I need to set those key and value pairs as fields and value to be indexed in elastic, so the field mfemve will have a value of 0,39, the field vmtoolsd will have a value of 0,39, and so on.

how can I do this?


Something like this i think.

#Here I suppose that you have only simple values (non array for exemple)
code => 
hash.each { |key, value|
  event.set(key, value); 

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