Created
September 1, 2020 11:00
-
-
Save unicolet/039a24288038611252dc5d88b4442a3e to your computer and use it in GitHub Desktop.
Parse idrac logs and show the most relevant fields
This file contains hidden or 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
import xml.etree.ElementTree as ET | |
import iso8601 | |
tree = ET.parse('310TKQ2-log.xml') | |
root = tree.getroot() | |
for child in root: | |
timestamp = iso8601.parse_date(child.attrib["Timestamp"]) | |
print("%s %s %s %s" % (timestamp, child.attrib["AgentID"], child.attrib["Severity"], child[0].text)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment