HEX
Server: LiteSpeed
System: Linux cp4.porkbun.com 5.14.0-611.20.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jan 14 06:35:04 EST 2026 x86_64
User: vxblllubpkafjsjw (1110)
PHP: 8.4.19
Disabled: NONE
Upload Files
File: //usr/lib/python3.9/site-packages/sos/report/plugins/__pycache__/logs.cpython-39.pyc
a

�>�h��@sXddlZddlmZmZmZmZGdd�de�ZGdd�dee�ZGdd�dee�ZdS)	�N)�Plugin�	PluginOpt�IndependentPlugin�	CosPluginc@s(eZdZdZdZdZdd�Zdd�ZdS)	�LogsBasezSystem logs�logs��systemZhardwareZstoragec	s�d}d|g}g}��|�r|t��|�ddd��>}|��D]$}|�d�r8|t�|��d�7}q8Wd�n1sr0Y|D]0}����|��s�q���|�}|��d|�7}q�|D].}|�d	�r�|dd�}��|�r���	|�q���	gd
����
d��jdd
dd�t�fdd�dD��}|�r~��
d��r~�jddgdd��jddd��jddd���d��r~��	ddg�dS) Nzetc/rsyslog.conf�/etc/syslog.conf�rzUTF-8)�encodingz$IncludeConfig�z^\S+\s+(-?\/.*$)\s+�-)z/var/log/auth.log*z/var/log/boot.logz/var/log/dist-upgradez/var/log/installerz/var/log/kern.log*z/var/log/messages*z/var/log/secure*z/var/log/syslog*z
/var/log/udevz/etc/rsyslog.confz/etc/rsyslog.dr
zjournalctl --disk-usagez/var/logT�s)�	recursiveZ
extra_optsc3s |]}����|d��VqdS)zlog/journal/N)�path_exists�	path_join)�.0�p��self��;/usr/lib/python3.9/site-packages/sos/report/plugins/logs.py�	<genexpr>As�z!LogsBase.setup.<locals>.<genexpr>)z/varz/runzsystemd-journaldZjournal_fullZjournal_all�d)�tags�priority�thisZjournal_since_boot)Zbootr�lastZjournal_last_boot�all_logsz/var/log/journal/*z/run/log/journal/*)r�openr�	readlines�
startswith�glob�splitZdo_regex_find_allZpath_isfileZ
add_copy_spec�add_cmd_outputZadd_dir_listing�anyZ
is_service�add_journal�
get_option)	rZrsyslogZconfsrZconf�lineZconfig�iZjournalrrr�setupsF

6



�
��zLogsBase.setupcCs|�ddd�dS)Nz
/etc/rsyslog*z (ActionLibdbiPassword |pwd=)(.*)z\1[********])Zdo_path_regex_subrrrr�postprocNs
�zLogsBase.postprocN)�__name__�
__module__�__qualname__Z
short_desc�plugin_name�profilesr+r,rrrrr
s
:rc@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__r0r1rrrrr2Vsr2cs,eZdZedddd�gZ�fdd�Z�ZS)�CosLogs�log-days�z"the number of days logs to collect)�name�defaultZdesccsDt���|�d�r |�d�n |�dd�}|jd|�d�d�dS)Nrzjournalctl -o exportr5r6r�days)Zsince)�superr+r(r%r')rr9��	__class__rrr+ls


z
CosLogs.setup)r-r.r/rZoption_listr+�
__classcell__rrr;rr4fs
��r4)	r#Zsos.report.pluginsrrrrrr2r4rrrr�<module>	sI