systemd_journal.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:intel-manager-for-lustre 作者: intel-hpdd 项目源码 文件源码
def parse_journal(data):
    """"
    Parse systemd journal entries.

    We do this on the agent rather than the manager because:
     * It allows us to distribute this bit of load
     * It localizes the means of log acquisition entirely to the agent,
       the manager never has any idea that the journal is in use or what
       forwarding protocol is being used.
    """

    utc_dt = get_localzone().localize(data['__REALTIME_TIMESTAMP'], is_dst=None).astimezone(pytz.utc)

    return {
        'datetime': datetime.datetime.isoformat(utc_dt),
        'severity': data['PRIORITY'],
        'facility': data['SYSLOG_FACILITY'],
        'source': data.get('SYSLOG_IDENTIFIER', "unknown"),
        'message': data['MESSAGE']
    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号