syslog 協議及格式

2021-09-01 12:04:47 字數 2755 閱讀 5790

官方文件:

6.  syslog message format

6.2.  header

6.2.1.  pri

pri=

6.2.2.  version

6.2.3.  timestamp

example 1

1985-04-12t23:20:50.52z

example 2

1985-04-12t19:20:50.52-04:00

example 3

2003-10-11t22:14:15.003z

example 4

2003-08-24t05:14:15.000003-07:00

6.2.4.  hostname

6.2.6.  procid

6.2.7.  msgid

6.3.  structured-data

6.3.1.  sd-element

6.3.2.  sd-id

6.3.3.  sd-param

6.3.4.  change control

6.3.5.  examples

example 1 - valid

this example is a structured data element with a non-iana controlled

sd-id of type "examplesdid@32473", which has three parameters.

example 2 - valid

this is the same example as in 1, but with a second structured data

element.  please note that the structured data element immediately

follows the first one (there is no sp between them).

example 3 - invalid

error : 兩個sd之間,多乙個空格sp character 

example 4 - invalid

error : 第乙個sd內部,多乙個空格

sp character 

example 5 - valid

[sigsig ver="1" rsid="1234" ... signature="..."]

example 5 is a valid example.  it shows a hypothetical iana-assigned

sd-id.  the ellipses denote missing content, which has been left out

of this example for brevity.

6.4.  msg

6.5.  examples

example 1 - with no structured-data

<34>1 2003-10-11t22:14:15.003z mymachine.example.com su - id47 - bom'su root' failed for lonvick on /dev/pts/8

#header的8個部分用空格sp,分割,<34>1除外,因為不需要sp就可以分割,

#header與structured-data,msg也是用sp分割。

facility : 4

severity : 2

version : 1

timestamp : 2003-10-11t22:14:15.003z

hostname : mymachine.example.com

procid : unknown indicated by "-" in the structured-data field

msgid : id47

structured-data : no this is indicated by "-" in the structured-data field

bom 是控制字元,以後再搞。

msg : 'su root' failed for lonvick on /dev/pts/8

最後的是msg,可以包含任意空格

example 2 - with no structured-data

<165>1 2003-08-24t05:14:15.000003-07:00 192.0.2.1 myproc 8710 - - %% it's time to make the do-nuts.

example 3 - with structured-data

<165>1 2003-10-11t22:14:15.003z mymachine.example.com

evntslog - id47 [examplesdid@32473 iut="3" eventsource=

event log entry...

example 4 - structured-data only, (no msg)

<165>1 2003-10-11t22:14:15.003z mymachine.example.com

evntslog - id47 [examplesdid@32473 iut="3" eventsource=

class="high"]

this example shows a message with only structured-data and no msg

part.  this is a valid message.

Syslog格式說明

syslog格式說明 裝置必須通過一些規則來配置,以便顯示或者傳遞事件資訊。不管管理員決定怎樣配置對事件資訊的處理,把這些資訊傳送到syslog接受者的過程一般都由下面部分構成 決定哪個幫助資訊要被傳送,要被傳送的級別,定義遠端的接受者。被傳輸的syslog資訊的格式主要有3個容易識別出來的部分,分...

壹 Modbus協議功能碼及格式簡述

目錄 一 modbus暫存器種類說明 二 modbus功能碼簡述 四 modbus彙總 正文 一 modbus暫存器種類說明 1 線圈狀態 輸出埠,可設定埠的輸出狀態,也可以讀取該位的輸出狀態 2 離散輸入狀態 輸入埠,通過外部設定改變輸入狀態,可讀但不可寫 3 保持暫存器 控制器執行時被設定的某些...

彙編指令及格式

第1 樓 程式流程控制指令 1 無條件轉移指令 長轉移 jmp 無條件轉移指令 call 過程呼叫 ret retf過程返回.2 條件轉移指令 短轉移,128到 127的距離內 當且僅當 sf xor of 1時,op1 ja jnbe 不小於或不等於時轉移.jae jnb 大於或等於轉移.jb j...