Skip to content

Instantly share code, notes, and snippets.

@ebot
Created June 14, 2011 18:56
Show Gist options
  • Select an option

  • Save ebot/1025586 to your computer and use it in GitHub Desktop.

Select an option

Save ebot/1025586 to your computer and use it in GitHub Desktop.
Scans the export logs and locates the doc id of specified job ids.
#!/usr/bin/env ruby -wKU
job_ids = [ '9555141D-0728-473C-9C98-F62E2D944F2F',
'C8AB8CF9-1A1D-45D8-A6E0-D65C3F6D7DBB',
'C8531ECE-E771-432C-8D24-86E1881EEA41',
'3531688C-BD89-4394-A786-DCF6FEE4753B',
'3C8890BE-4D24-4521-A780-1E896A3BB49B',
'D4A2B1D7-3ABE-4CA2-B22E-720552936D7D',
'309B2CD2-4277-45ED-870D-E7AC2CC51700',
'20B56A51-6D47-4207-AD34-8C0EAE49C6F9',
'0C68677C-2419-46FF-BAC8-975DE29AD8B8',
'7EFC833D-7EB4-4960-B448-16372495A2DF',
'5C6BCDE9-5E64-41B0-838D-D9449E90125F',
'479CEBF8-3A7E-4AF1-A743-602CA2F530EF',
'AAD90FFA-544E-4E80-88AA-C2EA95714920',
'D83BF722-89C8-4FAB-AD8C-FE3479355879',
'EAF7ECC4-2730-4134-9295-5B91DE1E6E6D',
'E043FBBC-460E-43A3-9CD8-6961549372F3',
'B1EDE5DB-849E-4EC0-9F67-C94F25E34F38',
'FA840527-3FA0-4F23-B711-8E4319BC5887',
'C7563177-93EC-4F97-A4BC-5913FE96B073',
'1127E4D1-1CE2-4225-8B0A-859F161AADDC',
'090E37AC-71AB-46B4-8260-92A61862E543',
'06384743-9C46-4EB5-BDCC-C0AD4DF83393',
'AD058B18-16C9-4FA3-BDEB-BCE9F0FFD28E',
'3329D285-0418-4139-8079-46A530711F56',
'50AF609A-C207-4982-B6AF-0918E8BE8A7B',
'7474F173-8695-4309-9444-F9E462C158F1',
'4FAA517A-7487-4583-9521-E03227E313B1',
'8DA3C1E2-A5B3-4BA7-8DA1-620CCC3EC602' ]
Dir.glob('./*').each do |log_file|
puts "Processing #{log_file}"
previous_line = ''
log = File.new log_file, 'r'
log.each_line do |line|
job_ids.each { |id| puts "#{previous_line.chomp} - #{line.chomp}" if line.include?(id) and line.include?('=>') }
previous_line = line
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment