Skip to content

Instantly share code, notes, and snippets.

@weaksauce
weaksauce / code2.rb
Last active April 27, 2022 08:17 — forked from gschanuel/code2.rb
require 'json'
file = File.read('./event.json')
event = JSON.parse(file)
keys = event['windows']['perfmon']['metrics']
hash=keys.map { |key, value|
key.split('_').reverse.reduce(value) {
|key_value, next_key| {
next_key => key_value
}