Sorry, yes, 7.4.4. For some reason it always writes to
/syslogdata/testing/1.txt, never to 2.txt or 3.txt.
Thanks for checking. Any thoughts on what might be breaking it? If the
messages were never being written out I'd say that something upstream of this
config section was the problem, but because they all write out OK I'm somewhat
stumped.
If anyone is thinking about using this, for safety's sake you may want to add a
final "catch-all" action in case there's the super-rare case where the $uptime
updates in between if clauses and causes none of them to be satisfied. Should
be extremely uncommon, but if you're pushing 10's of thousands of messages per
second, it might happen.
Also, is there any timer that has any higher resolution than $uptime? I can't
imagine there is, but have to ask, right? :)
Thanks!
Robert
> Date: Wed, 23 Oct 2013 09:30:46 +0400
> From: [email protected]
> To: [email protected]
> Subject: Re: [rsyslog] Another approach to action load balancing
>
> Hello.
>
> It actually works with my 7.5.5. Are you trying it for 7.4? It should
> work also...
>
>
> --
> Pavel Levshin
>
>
> 23.10.2013 2:50, Robert McIntyre:
> > I've been thinking about the action load balancing challenges, and wanted
> > to try out this approach:
> >
> > if ($uptime % 3 == 0)
> > then {
> > action(name="Act_File1"
> > type="omfile"
> > file="/syslogdata/testing/1.txt")
> > stop
> > }
> >
> > if ($uptime % 3 == 1)
> > then {
> > action(name="Act_File2"
> > type="omfile"
> > file="/syslogdata/testing/2.txt")
> > stop
> > }
> >
> > if ($uptime % 3 == 2)
> > then {
> > action(name="Act_File3"
> > type="omfile"
> > file="/syslogdata/testing/3.txt")
> > stop
> > }
> >
> > But, for some reason, it always only writes to 1.txt, and never hits the
> > other actions. I've tried different combinations of %$uptime%, $uptime,
> > $$uptime, etc, and all other combinations error out on startup.
> >
> > My goal was just to take something that incremented at the smallest
> > granularity I could find and use it to generate the sequence. Yes, this
> > approach means that it would be "bursty", with actions rotating through
> > every second, rather than every message, but it's still better than the
> > approach I'm using now.
> >
> > Any suggestions on why this isn't working?
> >
> > Thanks!
> > Robert
> >
> > _______________________________________________
> > rsyslog mailing list
> > http://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.
>
> _______________________________________________
> rsyslog mailing list
> http://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.
_______________________________________________
rsyslog mailing list
http://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.