$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. lesson9:分布式定时任务

    在实际的开发过程中,我们一定会遇到服务自有的定时任务,又因为现在的服务都是分布式的,但是对于定时任务,很多的业务场景下,还是只希望单台服务来执行,网上有很多分布式定时任务的框架,各位如感兴趣,可以自行 ...

  2. Unity3D基础学习 NGUI之Example 13 - Tabs简要概述

    首先建一个2D相机,在Anchor下新建一个子物体,添加WindowDrag Tilt脚本,用作拖动窗口 然后新建一个Panel,包含两个content,两个Tab,设置两个Content用来显示切换 ...

  3. 【.NET跨平台】mac上安装VS for mac步骤详解

    安装过程中提示以下内容 提示原文如下 It was not possible to complete an automatic installation. This might be due to a ...

  4. 怎样绕过oracle listener 监听的password设置

     怎样绕过oracle 监听的password设置: 1.找到监听进程pid ,并将它kill 掉 ps -ef|grep tns [oracle@lixora admin]$ ps -ef|gr ...

  5. 关于“无法解析的外部符号”和“该符号在函数_wmain 中被引用”的问题

    在VS2008和opendv的环境下: error LNK2019: 无法解析的外部符号_cvDestroyWindow,该符号在函数_wmain 中被引用 error LNK2019: 无法解析的外 ...

  6. 搭建HWI(HiveWebInterface)步骤总结

    众所周知,Hive有三种使用方式:CLI.HWI浏览器.Thrift客户端.安装配置完Hive后无需进行额外操作即可使用CLI.但是HWI则需要单独搭建.本文主要记录我自己搭建HWI的过程. 说明:本 ...

  7. mui实现退出当前应用

    var first = null; var showMenu = false; mui.back = function() { if(showMenu) { closeMenu();} else { ...

  8. SIEBEL安装问题

    安装siebel 分三步走: 1.安装oracle 11g 2.安装Client 3.分别安装siebel tools.siebel web client,之后打上补丁 安装siebel tools. ...

  9. CSS 之 margin知识点

    1.margin的百分比值 普通元素的百分比maigin相对于容器元素的宽度(width) 进行计算的. 这里我们在图片外面设置一个宽高分别为800 * 600的容器.设置img{ margin: 1 ...

  10. 关于VS2013连接远程数据库服务器的蛋疼问题

    填写完用户名和密码后,点击数据库下拉菜单,接着就报错误