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. Android WebServer相关项目

    1.AndServer AndServer是Android平台的Web Server和Web Framework. 它基于编译时注解提供了类似SpringMVC的注解和功能,如果您熟悉SpringMV ...

  2. Android Support v4、v7、v13、v14、v17的区别和应用场景

    Android Support v4.v7.v13.v14.v17的区别和应用场景   本文链接:https://blog.csdn.net/Aquarius_Seven/article/detail ...

  3. [转][linux][centos]嵌入式 Linux下编译并使用curl静态库

    #x86 ./configure --disable-shared --enable-static --disable-ftp --disable-ipv6 --disable-rtsp --disa ...

  4. pytorch常用的padding函数

    1)ReflectionPad2d CLASS torch.nn.ReflectionPad2d(padding) 使用输入边界的反射来填充输入tensor 对于N维的填充,使用torch.nn.fu ...

  5. Closing the Sim-to-Real Loop: Adapting Simulation Randomization with Real World Experience

    Closing the Sim-to-Real Loop: Adapting Simulation Randomization with Real World Experience 模拟到实际循环闭环 ...

  6. 将PCM格式存储成WAV格式文件

    将PCM格式存储成WAV格式文件 WAV比PCM多44个字节(在文件头位置多) 摘自:https://blog.csdn.net/u012173922/article/details/78849076 ...

  7. Go并发编程实战 第2版 PDF (中文版带书签)

    Go并发编程实战 第2版 目录 第1章 初识Go语言 1 1.1 语言特性 1 1.2 安装和设置 2 1.3 工程结构 3 1.3.1 工作区 3 1.3.2 GOPATH 4 1.3.3 源码文件 ...

  8. 报错:MetaException(message:Version information not found in metastore. )

    报错背景: CDH安装完成hive后启动失败. 报错现象: [main]: Metastore Thrift Server threw an exception... MetaException(me ...

  9. Spring Boot 使用MockMvc对象模拟调用Controller

    功能实现之后,我们要养成随手写配套单元测试的习惯,这在微服务架构中尤为重要.通常,我们实施微服务架构的时候,已经实现了前后端分离的项目与架构部署.那么在实现后端服务的时候,单元测试是在开发过程中用来验 ...

  10. 单机prometheus vs 集群kube-prometheus+prometheus-operator

    prometheus 组件: node-exporter:9100端口 https://segmentfault.com/a/1190000017959127