[rsyslog-notify] Forum Thread: imfile loses data using ReadMode=2 - (Mode 'post')

noreply at adiscon.com noreply at adiscon.com
Thu Jan 23 22:56:11 CET 2014


User: nfox 
Forumlink: http://kb.monitorware.com/viewtopic.php?p=24133#p24133

Message: 
----------
I think there's a bug with ReadMode=2, but wanted to know if anyone else
could replicate this. I'm using v7.4.7
The problem is that between each poll period, the first line from the new
poll period is lost.
This doesnt seem to happen with ReadMode=0 (I havent tried mode 1)

I can easily recreate it:

My config file: /etc/rsyslog.d/40-imfile.conf
[code:18r7nq7c]
$WorkDirectory /mnt/ephemeral/rsyslog
$MaxMessageSize 64k
module(load="imfile" PollingInterval="10")
input(type="imfile" File="/tmp/mystuffA"
      Tag="mystuffA"
      StateFile="mytuffA.state"
      Severity="info"
      Facility="local0"
      ReadMode="2"
      )

[/code:18r7nq7c]

1. In one tab, run: 
[code:18r7nq7c]rsyslogd -dn  2>&1 | grep myline[/code:18r7nq7c]
2. In another tab, run:
[code:18r7nq7c]for i in {1..60} ; do echo "mylineA: $i" | tee
-a "/tmp/mystuffA" ; sleep 5 ; done[/code:18r7nq7c]

Then switch to the first tab and watch items come through. I routinely see
numbers missing.
[code:18r7nq7c]3139.549214506:7f1ba5ac6700: omfile: start
of data: 'Jan 23 21:38:59 ip-10-236-185-153 mystuffA
mylineA: 2
3149.550677415:7f1ba5ac6700: omfile: start of data:
'Jan 23 21:39:09 ip-10-236-185-153 mystuffA mylineA: 4
3159.560304448:7f1ba5ac6700: omfile: start of data:
'Jan 23 21:39:19 ip-10-236-185-153 mystuffA mylineA: 6
3169.569738480:7f1ba5ac6700: omfile: start of data:
'Jan 23 21:39:29 ip-10-236-185-153 mystuffA mylineA: 8
[/code:18r7nq7c]

If you change the [color=#0000FF:18r7nq7c]1..60[/color:18r7nq7c] to
[color=#008000:18r7nq7c]1..200[/color:18r7nq7c] and the
[color=#0000FF:18r7nq7c]sleep 5[/color:18r7nq7c] to
[color=#008000:18r7nq7c]sleep 0.1[/color:18r7nq7c] in step 2, you'll get an
output like this: <!-- m --><a class="postlink"
href="https://gist.github.com/natefox/f898778d1d8cdd65b06b">https://gist.github.com/natefox/f898778d1d8cdd65b06b</a><!--
m -->
Note- I hit enter a couple times each time the output paused (ie: polling
period pauses). You'll notice line numbers skipping at each place I created
vertical space.


More information about the rsyslog-notify mailing list