up2date Logs - Files /var/log/up2date

Modules for parsing the content of log file /var/log/up2date in sosreport archives of RHEL.

class insights.parsers.up2date_log.Up2dateLog(context)[source]

Bases: LogFileOutput

Class for parsing the log file: /var/log/up2date.

Note

Please refer to its super-class insights.core.LogFileOutput

Example content of /var/log/up2date command is:

[Thu Feb  1 02:46:25 2018] rhn_register updateLoginInfo() login info
[Thu Feb  1 02:46:35 2018] rhn_register A socket error occurred: (-3, 'Temporary failure in name resolution'), attempt #1
[Thu Feb  1 02:46:40 2018] rhn_register A socket error occurred: (-3, 'Temporary failure in name resolution'), attempt #2
[Thu Feb  1 02:46:45 2018] rhn_register A socket error occurred: (-3, 'Temporary failure in name resolution'), attempt #3
[Thu Feb  1 02:46:50 2018] rhn_register A socket error occurred: (-3, 'Temporary failure in name resolution'), attempt #4
[Thu Feb  1 02:46:55 2018] rhn_register A socket error occurred: (-3, 'Temporary failure in name resolution'), attempt #5

...

Examples

>>> ulog.get('Temporary failure in name resolution')[0]['raw_message']
"[Thu Feb  1 02:46:35 2018] rhn_register A socket error occurred: (-3, 'Temporary failure in name resolution'), attempt #1"
time_format = '%a %b %d %H:%M:%S %Y'

The timestamp format assumed for the log files. A subclass can override this for files that have a different timestamp format. This can be:

  • A string in strptime() format.

  • A list of strptime() strings.

  • A dictionary with each item’s value being a strptime() string. This allows the item keys to provide some form of documentation.

  • A None value when there is no timestamp info in the log file