Hi -
Could someone please let me know how to concatenate a couple of strings in Ruby code over Logstash.
Below is the snippet of code:
for i in 0..arr.size - 1
cpu_hash = [cpu_hash, {'CPU#{i}' => arr[i].to_i}].reduce &:merge
end
Am creating a hash with the array of values. But I wanted to add the 'i' value in the key field along with the CPU word.
(So it creates unique key value)
In Ruby it works like this "CPU#{i}", not sure how does it work in Logstash. Please let me know. Thanks !