$InputFilePersistStateInterval 1

Specifies how often the state file shall be written when processing the input file. The default value is 0, which means a new state file is only written when the monitored files is being closed 

(end of rsyslogd execution). Any other value n means that the state file is written every time n file lines have been processed. This setting can be used to guard against message duplication due to 

fatal errors (like power fail). Note that this setting affects imfile performance, especially when set to a low value. Frequently writing the state file is very time consuming.

应用发送端:
uat-web02:/var/log/nginx# cat scan.log
dadadatest
uat-web02:/var/log/nginx# echo "dadadatest" >>scan.log
You have new mail in /var/spool/mail/root
uat-web02:/var/log/nginx# echo "1111111111111" >>scan.log
uat-web02:/var/log/nginx# echo "2222222222222" >>scan.log
uat-web02:/var/log/nginx# ps -ef | grep rsyslog
root 23550 1 0 14:50 ? 00:00:00 /sbin/rsyslogd -i /var/run/syslogd.pid
root 23576 22786 0 14:50 pts/1 00:00:00 grep rsyslog
uat-web02:/var/log/nginx# kill -9 23550
uat-web02:/var/log/nginx# ps -ef | grep rsyslog
root 23578 22786 0 14:50 pts/1 00:00:00 grep rsyslog
uat-web02:/var/log/nginx# service rsyslog start
Starting system logger: [ OK ]
uat-web02:/var/log/nginx# cat scan.log
dadadatest
dadadatest
1111111111111
2222222222222
You have new mail in /var/spool/mail/root rsyslog 接收端:
zjtest7-frontend:/data/scan# cat scan.2016-10-10
dadadatest
1111111111111
2222222222222
zjtest7-frontend:/data/scan# cat scan.2016-10-10
dadadatest
1111111111111
2222222222222
dadadatest
dadadatest
1111111111111
2222222222222 看到当kill后,会重发 解决:
input(type="imfile"
File="/var/log/nginx/scan.log"
Tag="uat-scan"
Severity="info"
PersistStateInterval="1"
Facility="local5")

解决rsyslog 断电或者被kill 重发问题的更多相关文章

  1. 解决服务器断电导致mysql数据库无法启动

    1.找到mysql数据库目录下的*.ini这个配置文件2.复制配置文件到桌面,当作备份3.打开配置文件,在配置文件里加上innodb_force_recovery=6这句,保存,然后重启服务器4重启完 ...

  2. 解决异常断电导致的: CorruptSSTableException: java.io.EOFException

    问题产生 服务器重启,导致cassandra损坏,整个集群不可用.所使用的cassandra为2.1.9版本. 问题描述 运行启动命令,报错如下: DEBUG :: All segments have ...

  3. linux服务之rsyslog

    日志片断分析 systemd:服务报出来的信息kvm:内核模块kvm报出来的信息kernel: tun: 内核的tun模块报出来的信息kernel: br0: 内核的br0模块报出来的信息kernel ...

  4. 解决adb.exe' and can be executed.

    百度google大家多说的是任务管理器 kill掉adb 或者重启adb server,但我任务管理器就没有adb ,猜测是某个程序占用了adb端口.于是按此思路查找. 5037为adb默认端口 查看 ...

  5. 解决Please ensure that adb is correctly located at 'D:\java\sdk\platform-tools\adb.exe' and can be executed.

    遇到问题描述: 运行android程序控制台输出 [2012-07-18 16:18:26 - ] The connection to adb is down, and a severe error ...

  6. Library cache lock 故障解决一例

    今天收到同事电话,说是数据库中一张名为acct_balance进行操作是奇慢,第一反映是不是扫行计划有问题,结果我错了,现将过程记录下来. 用pl/sql连上数据库情况:1.对acct_balance ...

  7. MySQL is running but PID file could not be found(解决方法)

    启动MySQL时报错: [root@xzw /]# service mysqld status MySQL is running but PID file could not be found    ...

  8. 数据库too many connections 解决方法

    问题:网站后台突然报错了,显示“too many connections........”这是咋回事? 解决: 先罗列几个有用的操作: ① mysql -u root -p  回车输入密码进入mysq ...

  9. Redis初步认识

    官网:redis.io Redis是一个开源的使用ANSI C语言编写.支持网络.可基于内存亦可持久化的日志型.Key-Value数据库,并提供多种语言的API.从2010年3月15日起,Redis的 ...

随机推荐

  1. AngularJS - 基本功能介绍

    转载自:http://www.cnblogs.com/powertoolsteam/p/angularjs-introdection.html (写得很好的Angular入门,可以试试) Angula ...

  2. Web —— java web 项目开发 笔记

    1.tomcat 配置虚拟路径:Tomcat下配置虚拟路径管理web项目 发布路径配置( 即虚拟目录配置 )  配置虚拟路径的4种方法 2.

  3. 解决NoSuchMethodError with Spring MutableValues异常问题

    今天下午项目启动时,遇到一个异常,导致无法启动: [ 221] ERROR - work.web.context.ContextLoader - Context initialization fail ...

  4. javascript获取对应页面的代码

    window.onload = function () { function getUrls(url) {//核心代码是url2这行代码,通过.replace()方法将对应的字符串替换成其他方式 va ...

  5. C++读写文件并排序

    比如一条记录是 1987 9 2 1988 8 26 代表公司员工生日 然后需要读入到系统 现在需要放入容器,并且排序 最后输出到新的文件中,按照年龄由大到小. #include "stda ...

  6. PHP Strict standards:Declaration of … should be compatible with that of…(转)

    今天把原来一份很老的PHP代码导入到了PaaS上,出现了许多Strict standards:Declaration of … should be compatible with that of…这样 ...

  7. hdu 2123

    #include <iostream> using namespace std; int main() { int i,t,n,j,k,f; cin>>t; while(t-- ...

  8. 匹配不含有某个信息的sql语句写法

    SELECT id,order_id,flight_info FROM order_flights WHERE mark=0 AND flight_info REGEXP '[^() DAY)]' O ...

  9. mouseover,mouseout和mouseenter,mouseleave

    mouseover和mouseout 鼠标指针进入或者离开被选元素或其子元素,都会触发相应事件. 非IE浏览器支持该事件. mouseenter和mouseleave 只有在鼠标指针进入或者离开被选元 ...

  10. Ehcache入门(一)——开发环境的搭建

    EhCache 是一个纯Java的进程内缓存框架,具有快速.精干等特点,是Hibernate中默认的CacheProvider. 那么.如何搭建Ehcache的开发环境呢? 1.下载相关的jar包,这 ...