syslog日志是系统日志的一种,可以存放在本地也可以发送到syslog日志服务器,

但是syslog日志由于的格式不统一,在日常工作中审计syslog日志是一种很麻烦的

事情。不过在2001出现了一份关于syslog标准的协议(建议)。

生成发送日志的叫做:Device

转发的叫做:Relay(可以作为Device或Coolector)

接收的叫做:Collector

传输标准使用UDP,消息大小小于1024个字节,端口使用514

PS:只是建议。

syslog日志可以分为三部分:

4.1 syslog Message Parts

   The full format of a syslog message seen on the wire has three
discernable parts. The first part is called the PRI, the second part
is the HEADER, and the third part is the MSG. The total length of
the packet MUST be 1024 bytes or less. There is no minimum length of
the syslog message although sending a syslog packet with no contents
is worthless and SHOULD NOT be transmitted.

标准格式:<23>Oct 9 23:33:20 192.168.0.1 ssh[1787]: Accepted publickey for root from.

PRF部分

Numerical             Facility
Code 0 kernel messages 内核信息;
1 user-level messages 用户进程信息;
2 mail system   电子邮件相关信息;
3 system daemons  后台进程相关信息;
4 security/authorization messages (note 1)
           5             messages generated internally by syslogd   系统日志信息
6 line printer subsystem 打印服务相关信息。
7 network news subsystem  新闻组服务器信息
8 UUCP subsystemuucp 生成的信息
9 clock daemon (note 2) 时钟守护进程
10 security/authorization messages (note 1) 安全授权信息
11 FTP daemon
12 NTP subsystem 子进程
13 log audit (note 1) 日志审核
14 log alert (note 1)日志警报
15 clock daemon (note 2)
16 local use 0 (local0)本地用户信息
17 local use 1 (local1)本地用户信息
18 local use 2 (local2)本地用户信息
19 local use 3 (local3)本地用户信息
20 local use 4 (local4)本地用户信息
21 local use 5 (local5)本地用户信息
22 local use 6 (local6)本地用户信息
23 local use 7 (local7)本地用户信息  
           Table 1.  syslog Message Facilities

        Note 1 - Various operating systems have been found to utilize
Facilities 4, 10, 13 and 14 for security/authorization,
audit, and alert messages which seem to be similar.
Note 2 - Various operating systems have been found to utilize
both Facilities 9 and 15 for clock (cron/at) messages. Each message Priority also has a decimal Severity level indicator.
These are described in the following table along with their numerical
values. Numerical Severity
Code 0 Emergency: system is unusable  紧急状态:系统无法使用
1 Alert: action must be taken immediately  警报:必须立即采取行动
2 Critical: critical conditions  临界:临界条件
3 Error: error conditions  错误:错误条件
4 Warning: warning conditions  警告:警告条件
5 Notice: normal but significant condition  通知:正常但重要的条件
6 Informational: informational messages  信息:信息消息
7 Debug: debug-level messages  调试:调试级别消息
           Table 2. syslog Message Severities

HEADER部分(可选)
  包括时间和HOST(主机或IP)
  时间
    格式为:MM dd hh:mm:ss
      用数字表示
      其中月MM为英文缩写:Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec
      有些长期日志可能会增加年字段。
  HOST
    主机或IP,无域名。
MSG部分
  包括TAG:Content
  TAG(可选):表示进程名及其进程号;格式:p[343]或p-343
  Content:表示应用程序的自定义信息。 这是对syslog日志格式的简单了解,为以后的日志审计提供基础
      

syslog 日志的更多相关文章

  1. logstash收集syslog日志

    logstash收集syslog日志注意:生产用syslog收集日志!!! 编写logstash配置文件 #首先我用rubydebug测试数据 [root@elk-node1 conf.d]# cat ...

  2. 利用Syslog Watcher在windows下部署syslog日志服务器

    1.概述 syslog协议是各种网络设备.服务器支持的网络日志记录标准.Syslog消息提供有关网络事件和错误的信息.系统管理员使用Syslog进行网络管理和安全审核. 通过专用的syslog服务器和 ...

  3. syslog之三:建立Windows下面的syslog日志服务器

    目录: <syslog之一:Linux syslog日志系统详解> <syslog之二:syslog协议及rsyslog服务全解析> <syslog之三:建立Window ...

  4. 关于syslog日志功能详解 事件日志分析、EventLog Analyzer

    关于syslog日志功能详解 事件日志分析.EventLog Analyzer 一.日志管理 保障网络安全 Windows系统日志分析 Syslog日志分析 应用程序日志分析 Windows终端服务器 ...

  5. ELK学习笔记之ELK分析syslog日志

    0x00 配置FIlebeat搜集syslog并发送至 #配置 mv /etc/filebeat/filebeat.yml /etc/filebeat/filebeat.yml.bak vim /et ...

  6. syslog之一:Linux syslog日志系统详解

    目录: <syslog之一:Linux syslog日志系统详解> <syslog之二:syslog协议及rsyslog服务全解析> <syslog之三:建立Window ...

  7. syslog日志格式解析

    在网上搜的文章,写的很全乎.摘抄如下,供大家参考学习 1.介绍 在Unix类操作系统上,syslog广泛应用于系统日志.syslog日志消息既可以记录在本地文件中,也可以通过网络发送到接收syslog ...

  8. 编译bash实现history的syslog日志记录

    摘要: 原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://koumm.blog.51cto.com/703525/1763145 一 ...

  9. syslog日志

    Syslog协议 系统日志(Syslog)协议是在一个IP网络中转发系统日志信息的标准,它是在美国加州大学伯克利软件分布研究中心(BSD)的TCP/IP系统实施中开发的,目前已成为工业标准协议,可用它 ...

随机推荐

  1. Tomcat7/8/8.5三种版本的redis-session-manager的jar和xml配置均不同

    chexagon/redis-session-manager: A tomcat8 session manager providing session replication via persiste ...

  2. Vue实现图片预加载

    <script>export default { data () { return { count: 0, } }, mounted: function() { this.preload( ...

  3. PHP判断文件大小是MB、GB、TB...

    <?php date_default_timezone_set ("PRC" ); function getFilePro($fileName){ if (!file_exi ...

  4. leetcode 874. Walking Robot Simulation

    874. Walking Robot Simulation https://www.cnblogs.com/grandyang/p/10800993.html 每走一步(不是没走commands里的一 ...

  5. centos和windows添加路由命令记录

    # 默认路由做香港出口route add default gw 192.168.10.33route add default gw 192.168.10.1 # 删除默认路由# route del d ...

  6. python制作简单excel统计报表3之将mysql数据库中的数据导入excel模板并生成统计图

    python制作简单excel统计报表3之将mysql数据库中的数据导入excel模板并生成统计图 # coding=utf-8 from openpyxl import load_workbook ...

  7. pytorch 计算图像数据集的均值和标准差

    在使用 torchvision.transforms进行数据处理时我们经常进行的操作是: transforms.Normalize((0.485,0.456,0.406), (0.229,0.224, ...

  8. Python初级 3 基本数学运算

    一. 四大基本运算操作符 1 加+ print(3 + 2) 2 减- print(3 - 2) 3 乘:* print(3 * 2) 4 除/, // print(3 / 2) print(3 // ...

  9. 报错:java.lang.ClassNotFoundException: org.codehaus.jackson.map.JsonMappingException

    报错背景: 执行hdfs-mysql的job任务的时候报错. 报错现象: Exception has occurred during processing command Exception: org ...

  10. pytorch 中Dataloader中的collate_fn参数

    一般的,默认的collate_fn函数是要求一个batch中的图片都具有相同size(因为要做stack操作),当一个batch中的图片大小都不同时,可以使用自定义的collate_fn函数,则一个b ...