Created
April 25, 2022 17:01
-
-
Save gschanuel/5dd4c69cb3c8cf87b585557e24a9757c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
file = File.read('./event.json') | |
event = JSON.parse(file) | |
keys = event['windows']['perfmon']['metrics'].to_hash.keys | |
keys.each{|key| | |
if ( key =~ /_/ ) | |
newkey = key.split("_").map { "[#{_1}]" }.join | |
event['windows']['perfmon']['metrics'].store(newkey, event['windows']['perfmon']['metrics'].delete(key)) | |
end | |
} | |
puts event |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment