How to create a system log checker using python


SUBMITTED BY: alemotta

DATE: April 13, 2017, 9:13 p.m.

FORMAT: Text only

SIZE: 274 Bytes

HITS: 573

  1. How to create a system log checker using python
  2. #!/usr/bin/env python
  3. logfile = open("/var/log/syslog", "r")
  4. for line in logfile:
  5. line_split = line.split()
  6. print line_split
  7. list = line_split[0], line_split[1], line_split[2], line_split[4]
  8. print list

comments powered by Disqus