Read Oracle Alert Logs

#!/usr/bin/python # -*- coding: utf-8 -*- from BeautifulSoup import BeautifulStoneSoup log = open(‘log.xml’, ‘r’).read() dalog = {} soup = BeautifulStoneSoup(log) messages = soup.findAll(‘msg’) n = 0 for node in messages: dalog[n] = {} for f1, f2 in node.attrs: dalog[n][f1] = f2 dalog[n][‘txt’] = node.txt.text n = n + 1 # Check first message node = […]