syslogd analysis
syslogd analysis
- 1. syslogd_main()
- 1. // parse parameters (m:n):l:Ss:b:R:LC::Df:
- 2. parse_syslogdcfg() // parse conf file, priority, facility
- 3. do_syslogd() // main loop
- 1. read(sock_fd, recvbuf)
- 2. detect the one line msg
- 3. add '\n'
- 4. sendto(rh->remoteFD, recvbuf) // resolve remoteHosts and send msg to remote host
- 4. return
patch for add hostname in busybox’s syslog
https://dev.openwrt.org/ticket/13431
patch for add tcp in busybox’s syslog
https://dev.openwrt.org/ticket/10435
- $template Insider,"/var/log/host/Insider.log" #定义TC:日志存放路径
- $template Stranger,"/var/log/host/Stranger.log" #定义TCBeta:日志存放路径
- $template tocFormat,"%msg%\n" #定义toc日志format
- :rawmsg,contains,"[Insider]" -?Insider;tocFormat #接受TC:日志,并应用tocFormat格式
- :rawmsg,contains,"[Stranger]" -?Stranger;tocFormat #接受TCBeta:日志,并应用tocFormat格式
nicephil@gmail.com 2017-7-4