Skip to content

Instantly share code, notes, and snippets.

@unicolet
Created September 1, 2020 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unicolet/039a24288038611252dc5d88b4442a3e to your computer and use it in GitHub Desktop.
Save unicolet/039a24288038611252dc5d88b4442a3e to your computer and use it in GitHub Desktop.
Parse idrac logs and show the most relevant fields
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