On 19.02.2022 12:40, David Lang via rsyslog wrote:
On Sat, 19 Feb 2022, Mariusz Kruk via rsyslog wrote:

OK, let me get this straight because the legacy format is confusing at times :-)

If I do

$ActionQueueType LinkedList # use asynchronous processing
$ActionQueueFileName srvrfwd # set file name, also enables disk mode
$ActionResumeRetryCount -1 # infinite retries on insert failure
$ActionQueueSaveOnShutdown on # save in-memory data if rsyslog shuts down
*.* /tmp/whatever.log
*.* @@some.host:port

The queue parameters will get applied only to the first action? (in this case - to file write)?

In order to apply them to the next action I'd have to repeat the $ActionWhatever statements?

mostly, not always.

queue items only apply to the next action, I dont' remember if retryCount applies only to the next action or to all actions until it's set to something else.

there is a reason why most of the $foo settings are discouraged. If you can do something in one line with the old format, it can make sense to do it. but if you have to do several $foo lines and then your action, you probably should switch to the action() format to make it explicitly clear what you are doing.

OK. I did some testing on my own and it seems to confirm that.

I did a very simple setup

module(load="imudp")
input(type="imudp" port="10514")
$WorkDirectory /tmp/rsyslog1
$ActionQueueType LinkedList # use asynchronous processing
$ActionQueueFileName srvrfwd # set file name, also enables disk mode
$ActionResumeRetryCount -1 # infinite retries on insert failure
$ActionQueueSaveOnShutdown on # save in-memory data if rsyslog shuts down
$ActionResumeInterval 1
#*.* -/tmp/log.log
*.* @@127.0.0.1:10514

If I run rsyslogd in debug mode and I don't have anything running on TCP port to receive forwarded data, I see that messages do indeed get queued and retried every second.

But if I uncomment local file logging, it's that action that gets retried in case of failure (I had some pre-existing /tmp/log.log file with wrong ownership so the action would fail until I removed it) but the forward is tried only once and forgotten about (at least for some time; I didn't wait very long for retry but it definitely wasn't retried as often as $ActionResumeInterval).

So I suppose the clou of the OP's problem is that his config (which relies on a very old guide - way back from 2008 if I see correctly) sets the retry parameters for the wrong action.

Maybe it's worth mentioning in that document that it's a bit outdated and possibly misleading if applied "incorrectly"?

MK


_______________________________________________
rsyslog mailing list
https://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to