HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //proc/1233/cwd/usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/logs.cpython-310.pyc
o

i��d��@sXddlZddlmZmZmZmZGdd�de�ZGdd�dee�ZGdd�dee�ZdS)	�N)�Plugin�	PluginOpt�IndependentPlugin�	CosPluginc@s(eZdZdZdZdZdd�Zdd�ZdS)	�LogsBasezSystem logs�logs��system�hardware�storagec	s�ddg}g}��d�}��d�r?t��d�d��}|��D]}|�d�r/|t�|��d�7}qWd�n1s:wY|D]}����|��sLqA��|�}|��d|�7}qA|D]}|�d�ri|dd�}��	|�rs��
|�q\��
gd	����d
���d�t�fdd
�dD��}|r���
d�r��j|ddgdd��jd|dd��jd|dd���d�r���
ddg�dSdS��d�sψ�
gd��dS��
gd��dS)N�/etc/syslog.conf�/etc/rsyslog.conf�since�rz$IncludeConfig�z^\S+\s+(-?\/.*$)\s+�-)	rr
z/etc/rsyslog.dz/var/log/boot.logz/var/log/installerz/var/log/messages*z/var/log/secure*z
/var/log/udevz/var/log/dist-upgradezjournalctl --disk-usagezls -alRh /var/log/csg|]}����|d���qS)zlog/journal/)�path_exists�	path_join)�.0�p��self��9/usr/lib/python3/dist-packages/sos/report/plugins/logs.py�
<listcomp>?s�z"LogsBase.setup.<locals>.<listcomp>)z/varz/runzsystemd-journald�journal_full�journal_all�d)r�tags�priority�this�journal_since_boot)�bootrr�last�journal_last_boot�all_logsz/var/log/journal/*z/run/log/journal/*)	z/var/log/syslogz/var/log/syslog.1z/var/log/syslog.2*z/var/log/kern.logz/var/log/kern.log.1z/var/log/kern.log.2*z/var/log/auth.logz/var/log/auth.log.1z/var/log/auth.log.2*)z/var/log/syslog*z/var/log/kern.log*z/var/log/auth.log*)�
get_optionr�openr�	readlines�
startswith�glob�split�do_regex_find_all�path_isfile�
add_copy_spec�add_cmd_output�any�
is_service�add_journal)	r�confsrr�conf�line�config�i�journalrrr�setups^


���



�

����

��
zLogsBase.setupcCs|�ddd�dS)Nz
/etc/rsyslog*z (ActionLibdbiPassword |pwd=)(.*)z\1[********])�do_path_regex_subrrrr�postprocas
�zLogsBase.postprocN)�__name__�
__module__�__qualname__�
short_desc�plugin_name�profilesr9r;rrrrr
sMrc@seZdZdZdZdZdS)�IndependentLogsa�
    This plugin will collect logs traditionally considered to be "system" logs,
    meaning those such as /var/log/messages, rsyslog, and journals that are
    not limited to unit-specific entries.

    Note that the --since option will apply to journal collections by this
    plugin as well as the typical application to log files. Most users can
    expect typical journal collections to include the "full" journal, as well
    as journals limited to this boot and the previous boot.
    rrN)r<r=r>�__doc__r@rArrrrrBisrBcs,eZdZedddd�gZ�fdd�Z�ZS)�CosLogs�log_days�z"the number of days logs to collect)�name�default�desccsFtt|���|�d�r|�d�dS|�dd�}|jd|d�dS)Nr%zjournalctl -o exportrErFz-%ddays)r)�superrDr9r&r/r2)r�days��	__class__rrr9s

z
CosLogs.setup)r<r=r>r�option_listr9�
__classcell__rrrLrrDys��rD)	r*�sos.report.pluginsrrrrrrBrDrrrr�<module>s
\