$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. MySQL慢查询(二) - pt-query-digest详解慢查询日志

    一.简介 pt-query-digest是用于分析mysql慢查询的一个工具,它可以分析binlog.General log.slowlog,也可以通过SHOWPROCESSLIST或者通过tcpdu ...

  2. tomcat安全配置之禁用Directory Listing

    什么是Directory Listing?通俗点讲,就是在webapp的目录下如果没有放置index.html或者类似的文件,如果从IE或者其它浏览器文章这个路径时,会惊喜的发现这个目录下的文件列表被 ...

  3. Android 监控网络状态

    public static boolean isNetworkAvailable(Context context) { ConnectivityManager connectivity = (Conn ...

  4. rk3288 ov8858 camera移植

    平台:瑞芯的rk3288 SDK:4.4/5.0/5.1 作者:fulinux *****本文同意转载.只是请注明出处:http://blog.csdn.net/fulinus**** rk3288的 ...

  5. List 去处自定义重复对象方法

    list泛型集合去除重复项,对于单一的某个字段非常简单,但是对于一些自定义要求的还需自定义规则.例子代码: /************绑定乘客信息********/ List<RT.Model. ...

  6. MySQL创建新用户、增加账户的2种方法及使用实例

    可以用两种方式创建MySQL账户:1.使用GRANT语句2.直接操作MySQL授权表最好的方法是使用GRANT语句,因为这样更精确,错误少.创建超级用户: mysql> GRANT ALL PR ...

  7. yii [error] [exception.CHttpException.404] exception 'CHttpException' with message 'Unable to resolve the request "favicon.ico".'

    yii使用中,发现runtime文件夹下出现这个错误信息 解决办法:在生成的APP程序根目录下建.htaccess文件(前提是需要开启apache重写,具体如何开,查资料咯) 然后配置如下 <I ...

  8. LINUX更改时区和时间

    因为公司运营海外游戏,服务器也多数放在国外,有时候要求服务器时区和时间要与所服务的地区一致,这里就涉及到更改服务器时区和时间的问题: 下面以一台在美国的服务器为例,我们的IDC提供商是一家德国公司,服 ...

  9. IO-文件 File 复制 读写 总结

    一定要注意: 传入的参数,应该是包含文件名的完整路径名,不能把一个文件复制到[文件夹]中,因为[文件夹]本身是不能有输入输出流的,只能复制到一个[文件]中,否则会报异常. 以字节流读写的三种方式 pu ...

  10. python单元测试之unittest

    unittest是python标准库,从2.1开始就有. 标准的使用流程: 1:实现一个unittest.TestCase的子类 2:在其中定义以_test开头的实例函数 3:用unittest.ma ...