syslogd analysis

syslogd analysis

  1. 1. syslogd_main() 
  2. 1. // parse parameters (m:n):l:Ss:b:R:LC::Df: 
  3. 2. parse_syslogdcfg() // parse conf file, priority, facility 
  4. 3. do_syslogd() // main loop 
  5. 1. read(sock_fd, recvbuf) 
  6. 2. detect the one line msg 
  7. 3. add '\n' 
  8. 4. sendto(rh->remoteFD, recvbuf) // resolve remoteHosts and send msg to remote host 
  9. 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

  1. $template Insider,"/var/log/host/Insider.log" #定义TC:日志存放路径  
  2. $template Stranger,"/var/log/host/Stranger.log" #定义TCBeta:日志存放路径  
  3. $template tocFormat,"%msg%\n" #定义toc日志format  
  4. :rawmsg,contains,"[Insider]" -?Insider;tocFormat #接受TC:日志,并应用tocFormat格式  
  5. :rawmsg,contains,"[Stranger]" -?Stranger;tocFormat #接受TCBeta:日志,并应用tocFormat格式  

nicephil@gmail.com 2017-7-4

posted on 2017-07-05 10:41  nicephil  阅读(333)  评论(0编辑  收藏  举报

导航