Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: RSyslog: users

forwarding server template?

 

 

RSyslog users RSS feed   Index | Next | Previous | View Threaded


jrhett at netconsonance

Apr 4, 2012, 5:35 PM

Post #1 of 13 (461 views)
Permalink
forwarding server template?

It doesn't appear that you can put forwarding server information in a template. Am I overlooking something? Short of sending a patch to enable this, are there any good ways to do this?

What I want to do is:

$template MyTemplate,"unique %FROMHOST% %MSG%"
$template SyslogHost,"@@hostname:514;MyTemplate"
local0.* ?SyslogHost

This is to replace a syslog-ng implementation which has a syntax that does this:

destination SyslogHost { tcp("hostname" port(514) template("unique $HOST $MSGONLY\n")); };

--
Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source and other randomness

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/


david at lang

Apr 4, 2012, 11:06 PM

Post #2 of 13 (443 views)
Permalink
Re: forwarding server template? [In reply to]

On Wed, 4 Apr 2012, Jo Rhett wrote:

> It doesn't appear that you can put forwarding server information in a template. Am I overlooking something? Short of sending a patch to enable this, are there any good ways to do this?
>
> What I want to do is:
>
> $template MyTemplate,"unique %FROMHOST% %MSG%"
> $template SyslogHost,"@@hostname:514;MyTemplate"
> local0.* ?SyslogHost
>
> This is to replace a syslog-ng implementation which has a syntax that does this:
>
> destination SyslogHost { tcp("hostname" port(514) template("unique $HOST $MSGONLY\n")); };

the templates are used for either the message itself, or the local
filename to write to, not for other uses

so you would do

local0.* @@hostname;MyTemplate

to send via TCP to hostname using the message format in MyTemplate

the ? action is used for if you want to write to different file names
based on the contents of the message.

David Lang
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/


jrhett at netconsonance

Apr 5, 2012, 12:29 AM

Post #3 of 13 (442 views)
Permalink
Re: forwarding server template? [In reply to]

> On Wed, 4 Apr 2012, Jo Rhett wrote:
>> What I want to do is:
>>
>> $template MyTemplate,"unique %FROMHOST% %MSG%"
>> $template SyslogHost,"@@hostname:514;MyTemplate"
>> local0.* ?SyslogHost
>>
>> This is to replace a syslog-ng implementation which has a syntax that does this:
>>
>> destination SyslogHost { tcp("hostname" port(514) template("unique $HOST $MSGONLY\n")); };

On Apr 4, 2012, at 11:06 PM, david [at] lang wrote:
> the templates are used for either the message itself, or the local filename to write to, not for other uses
>
> so you would do
>
> local0.* @@hostname;MyTemplate
>
> to send via TCP to hostname using the message format in MyTemplate
>
> the ? action is used for if you want to write to different file names based on the contents of the message.


The issue is the repeating of identical information throughout the rsyslog.conf. With a few hundred lines, and dozens of references to the same loghost, same port, etc it becomes somewhat silly to make changes. It would be very useful to be able to define the hostname, port and potentially the format in a single place. (as syslog-ng allows)

--
Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source and other randomness

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/


rgerhards at hq

Apr 5, 2012, 1:22 AM

Post #4 of 13 (439 views)
Permalink
Re: forwarding server template? [In reply to]

> The issue is the repeating of identical information throughout the
> rsyslog.conf. With a few hundred lines, and dozens of references to
> the same loghost, same port, etc it becomes somewhat silly to make
> changes. It would be very useful to be able to define the hostname,
> port and potentially the format in a single place. (as syslog-ng
> allows)

This dynamic hostname is not supported. Actually, it's the first time someone
asks, but I have to admit I see some value in it.

However, is
s/oldname/newname/g
such a problem?

Anyhow, if you send a patch, I am definitely interested in adding it.

Rainer
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/


jrhett at netconsonance

Apr 5, 2012, 9:40 AM

Post #5 of 13 (445 views)
Permalink
Re: forwarding server template? [In reply to]

On Apr 5, 2012, at 1:22 AM, Rainer Gerhards wrote:
>> The issue is the repeating of identical information throughout the
>> rsyslog.conf. With a few hundred lines, and dozens of references to
>> the same loghost, same port, etc it becomes somewhat silly to make
>> changes. It would be very useful to be able to define the hostname,
>> port and potentially the format in a single place. (as syslog-ng
>> allows)
>
> This dynamic hostname is not supported. Actually, it's the first time someone
> asks, but I have to admit I see some value in it.
>
> However, is
> s/oldname/newname/g
> such a problem?
>
> Anyhow, if you send a patch, I am definitely interested in adding it.


We ran into this because we are sending to the same host on a different ports using different templates. We went to move one of these services to a different host, and someone did exactly s/hostname/newhostname/ not realizing it affected *all* services on that host, and broke the rest of them. Fixing this required a slow and careful review of the entire file to determine which ones should be where.

It's also quite easy to write a rule and send the data to the wrong location be accident. Scoping around inside the file to determine port and template involves human estimation, which gets different results from different people. Macros like "UsageDataServer" and "TracefileServer" make it a lot easier to get the right choice ;-)

I will say that this is high enough priority to rate coding a fix for it, but I also don't see much availability in my upcoming schedule to get to that. If someone else is willing to tackle this I'd appreciate it. If not I'll try to get to it when my schedule opens up.

--
Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source and other randomness

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/


david at lang

Apr 5, 2012, 10:41 AM

Post #6 of 13 (445 views)
Permalink
Re: forwarding server template? [In reply to]

On Thu, 5 Apr 2012, Jo Rhett wrote:

>> On Wed, 4 Apr 2012, Jo Rhett wrote:
>>> What I want to do is:
>>>
>>> $template MyTemplate,"unique %FROMHOST% %MSG%"
>>> $template SyslogHost,"@@hostname:514;MyTemplate"
>>> local0.* ?SyslogHost
>>>
>>> This is to replace a syslog-ng implementation which has a syntax that does this:
>>>
>>> destination SyslogHost { tcp("hostname" port(514) template("unique $HOST $MSGONLY\n")); };
>
> On Apr 4, 2012, at 11:06 PM, david [at] lang wrote:
>> the templates are used for either the message itself, or the local filename to write to, not for other uses
>>
>> so you would do
>>
>> local0.* @@hostname;MyTemplate
>>
>> to send via TCP to hostname using the message format in MyTemplate
>>
>> the ? action is used for if you want to write to different file names based on the contents of the message.
>
>
> The issue is the repeating of identical information throughout the
> rsyslog.conf. With a few hundred lines, and dozens of references to the
> same loghost, same port, etc it becomes somewhat silly to make changes.
> It would be very useful to be able to define the hostname, port and
> potentially the format in a single place. (as syslog-ng allows)

rsyslog does not currently support the concept of combining the
destination with the format the way that syslog-ng does. Personally I've
had more headaches working around the syslog-ng way of doing things where
I end up having to repeat the same information many times in all the
templates :-)

that being said, you should probably look into the rulesets feature. It
would allow you to have filter criteria that direct the log to a specific
ruleset. That ruleset can then have additional filter criteria if needed,
and then can specify the destination and template.

David Lang
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/


jrhett at netconsonance

Apr 5, 2012, 10:51 AM

Post #7 of 13 (443 views)
Permalink
Re: forwarding server template? [In reply to]

On Apr 5, 2012, at 10:41 AM, david [at] lang wrote:
> rsyslog does not currently support the concept of combining the destination with the format the way that syslog-ng does. Personally I've had more headaches working around the syslog-ng way of doing things where I end up having to repeat the same information many times in all the templates :-)

Having a macro creates more copy/paste for you? I find that hard to believe.

I do agree that it might be an improvement to allow the template to be overridden. That might be the source of the problem for your situation.

> that being said, you should probably look into the rulesets feature. It would allow you to have filter criteria that direct the log to a specific ruleset. That ruleset can then have additional filter criteria if needed, and then can specify the destination and template.

Yeah, I did the entire upgrade from 3.22 to 5.8 exactly for that reason. Not quite sure this will solve my needs.

FWIW, I'm also deeply disturbed by the lack of closures in the syntax. It's really hard to read a long configuration file with multiple rulesets. I've ended up creating fake/comment closures and using indentation just to make it readable.

starting a rule

rule one
rule two

this-command-is-outside-the-ruleset-but-only-if-you-know-the-syntax

rule three -- is not in the previous ruleset, but you won't know that if you don't that the previous command wasn't.
rule four

This is really, really hard to read without knowing the syntax inside and out. I'm sure you and Rainer do, but using closures would greatly improve the readability.

ruleset {

}

command-outside-the-ruleset

ruleset {

}

--
Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source and other randomness

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/


david at lang

Apr 5, 2012, 11:01 AM

Post #8 of 13 (438 views)
Permalink
Re: forwarding server template? [In reply to]

On Thu, 5 Apr 2012, Jo Rhett wrote:

>> that being said, you should probably look into the rulesets feature. It would allow you to have filter criteria that direct the log to a specific ruleset. That ruleset can then have additional filter criteria if needed, and then can specify the destination and template.
>
> Yeah, I did the entire upgrade from 3.22 to 5.8 exactly for that reason. Not quite sure this will solve my needs.
>
> FWIW, I'm also deeply disturbed by the lack of closures in the syntax. It's really hard to read a long configuration file with multiple rulesets. I've ended up creating fake/comment closures and using indentation just to make it readable.

the new syntax introduced in 6.x was created specifically to address this
issue. Unfortunantly the pre-6.x syntax is derived from the historic
syslog syntax which was very limited.

David Lang

> starting a rule
>
> rule one
> rule two
>
> this-command-is-outside-the-ruleset-but-only-if-you-know-the-syntax
>
> rule three -- is not in the previous ruleset, but you won't know that if you don't that the previous command wasn't.
> rule four
>
> This is really, really hard to read without knowing the syntax inside and out. I'm sure you and Rainer do, but using closures would greatly improve the readability.
>
> ruleset {
> ?
> }
>
> command-outside-the-ruleset
>
> ruleset {
> ?
> }
>
>
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/


jrhett at netconsonance

Apr 5, 2012, 4:59 PM

Post #9 of 13 (443 views)
Permalink
Re: forwarding server template? [In reply to]

On Apr 5, 2012, at 1:22 AM, Rainer Gerhards wrote:
>> The issue is the repeating of identical information throughout the
>> rsyslog.conf. With a few hundred lines, and dozens of references to
>> the same loghost, same port, etc it becomes somewhat silly to make
>> changes. It would be very useful to be able to define the hostname,
>> port and potentially the format in a single place. (as syslog-ng
>> allows)
>
> This dynamic hostname is not supported. Actually, it's the first time someone
> asks, but I have to admit I see some value in it.
>
> However, is
> s/oldname/newname/g
> such a problem?


I just wanted to add a new answer to this. If I am reading the queue configuration and some online examples right, then I have to put 4-5 lines of queue configuration if I wanted a LinkedList queue for forwarding to a remote system. This really, really makes the case for defining a forwarding queue in a single place, as this gets very silly

$WorkDirectory /var/spool/rsyslog/fwd-host1
$ActionQueueFileName fwdHost1
$ActionQueueMaxDiskSpace 1g
$ActionQueueSaveOnShutdown on
$ActionQueueType LinkedList
$ActionResumeRetryCount -1
if this and that then @@remoteHost1:514

$WorkDirectory /var/spool/rsyslog/fwd-host2
$ActionQueueFileName fwdHost2
$ActionQueueMaxDiskSpace 1g
$ActionQueueSaveOnShutdown on
$ActionQueueType LinkedList
$ActionResumeRetryCount -1
if one and another then @@remoteHost2:514

$WorkDirectory /var/spool/rsyslog/fwd-host1
$ActionQueueFileName fwdHost1
$ActionQueueMaxDiskSpace 1g
$ActionQueueSaveOnShutdown on
$ActionQueueType LinkedList
$ActionResumeRetryCount -1
if more and yetmore then @@remoteHost1:514

Please please tell me I am misunderstanding and you can easily define a single queue on a per-host basis, no matter how many rules forward messages to that host.

--
Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source and other randomness

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/


rgerhards at hq

Apr 7, 2012, 5:24 AM

Post #10 of 13 (443 views)
Permalink
Re: forwarding server template? [In reply to]

> -----Original Message-----
> From: rsyslog-bounces [at] lists [mailto:rsyslog-
> bounces [at] lists] On Behalf Of Jo Rhett
> Sent: Friday, April 06, 2012 1:59 AM
> To: rsyslog-users
> Subject: Re: [rsyslog] forwarding server template?
>
> On Apr 5, 2012, at 1:22 AM, Rainer Gerhards wrote:
> >> The issue is the repeating of identical information throughout the
> >> rsyslog.conf. With a few hundred lines, and dozens of references to
> >> the same loghost, same port, etc it becomes somewhat silly to make
> >> changes. It would be very useful to be able to define the hostname,
> >> port and potentially the format in a single place. (as syslog-ng
> >> allows)
> >
> > This dynamic hostname is not supported. Actually, it's the first time
> someone
> > asks, but I have to admit I see some value in it.
> >
> > However, is
> > s/oldname/newname/g
> > such a problem?
>
>
> I just wanted to add a new answer to this. If I am reading the queue
> configuration and some online examples right, then I have to put 4-5
> lines of queue configuration if I wanted a LinkedList queue for
> forwarding to a remote system. This really, really makes the case for
> defining a forwarding queue in a single place, as this gets very silly
>
> $WorkDirectory /var/spool/rsyslog/fwd-host1
> $ActionQueueFileName fwdHost1
> $ActionQueueMaxDiskSpace 1g
> $ActionQueueSaveOnShutdown on
> $ActionQueueType LinkedList
> $ActionResumeRetryCount -1
> if this and that then @@remoteHost1:514
>
> $WorkDirectory /var/spool/rsyslog/fwd-host2
> $ActionQueueFileName fwdHost2
> $ActionQueueMaxDiskSpace 1g
> $ActionQueueSaveOnShutdown on
> $ActionQueueType LinkedList
> $ActionResumeRetryCount -1
> if one and another then @@remoteHost2:514
>
> $WorkDirectory /var/spool/rsyslog/fwd-host1
> $ActionQueueFileName fwdHost1
> $ActionQueueMaxDiskSpace 1g
> $ActionQueueSaveOnShutdown on
> $ActionQueueType LinkedList
> $ActionResumeRetryCount -1
> if more and yetmore then @@remoteHost1:514
>
> Please please tell me I am misunderstanding and you can easily define a
> single queue on a per-host basis, no matter how many rules forward
> messages to that host.

You are understanding it right ;) The plan is to include named actions in v6,
which will solve this issue. Anyhow, patches are always welcome.

Rainer
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/


jrhett at netconsonance

Apr 9, 2012, 4:46 PM

Post #11 of 13 (438 views)
Permalink
Re: forwarding server template? [In reply to]

On Apr 7, 2012, at 5:24 AM, Rainer Gerhards wrote:
>> I just wanted to add a new answer to this. If I am reading the queue
>> configuration and some online examples right, then I have to put 4-5
>> lines of queue configuration if I wanted a LinkedList queue for
>> forwarding to a remote system. This really, really makes the case for
>> defining a forwarding queue in a single place, as this gets very silly
>>
>> $WorkDirectory /var/spool/rsyslog/fwd-host1
>> $ActionQueueFileName fwdHost1
>> $ActionQueueMaxDiskSpace 1g
>> $ActionQueueSaveOnShutdown on
>> $ActionQueueType LinkedList
>> $ActionResumeRetryCount -1
>> if this and that then @@remoteHost1:514
>>
>> $WorkDirectory /var/spool/rsyslog/fwd-host2
>> $ActionQueueFileName fwdHost2
>> $ActionQueueMaxDiskSpace 1g
>> $ActionQueueSaveOnShutdown on
>> $ActionQueueType LinkedList
>> $ActionResumeRetryCount -1
>> if one and another then @@remoteHost2:514
>>
>> $WorkDirectory /var/spool/rsyslog/fwd-host1
>> $ActionQueueFileName fwdHost1
>> $ActionQueueMaxDiskSpace 1g
>> $ActionQueueSaveOnShutdown on
>> $ActionQueueType LinkedList
>> $ActionResumeRetryCount -1
>> if more and yetmore then @@remoteHost1:514
>>
>> Please please tell me I am misunderstanding and you can easily define a
>> single queue on a per-host basis, no matter how many rules forward
>> messages to that host.

On Apr 7, 2012, at 5:24 AM, Rainer Gerhards wrote:
> You are understanding it right ;) The plan is to include named actions in v6,
> which will solve this issue. Anyhow, patches are always welcome.


This is perhaps the one thing I understand the least, and I'm looking forward to your changes. For now, is the best practice for this to put each queue inside a separate file, put the ActionQueue directives at the top and put every rule that forwards to that host within the same file? Like

/etc/rsyslog.conf:
# Include all config files in /etc/rsyslog.d/
$IncludeConfig /etc/rsyslog.d/*.conf

/etc/rsyslog.d/fwd-host1.conf:
$WorkDirectory /var/spool/rsyslog/fwd-host1
$ActionQueueFileName fwdHost1
$ActionQueueMaxDiskSpace 1g
$ActionQueueSaveOnShutdown on
$ActionQueueType LinkedList
$ActionResumeRetryCount -1

if this and that then @@remoteHost1:514

if more and yetmore then @@remoteHost1:514

if trimore then @@remoteHost1:514

/etc/rsyslog.d/fwd-host2.conf:
$WorkDirectory /var/spool/rsyslog/fwd-host2
$ActionQueueFileName fwdHost2
$ActionQueueMaxDiskSpace 1g
$ActionQueueSaveOnShutdown on
$ActionQueueType LinkedList
$ActionResumeRetryCount -1

if one and another then @@remoteHost2:514

Will that work making it easy to maintain a single queue for each remote host?

--
Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source and other randomness

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/


rgerhards at hq

Apr 9, 2012, 11:58 PM

Post #12 of 13 (434 views)
Permalink
Re: forwarding server template? [In reply to]

> -----Original Message-----
> From: rsyslog-bounces [at] lists [mailto:rsyslog-
> bounces [at] lists] On Behalf Of Jo Rhett
> Sent: Tuesday, April 10, 2012 1:47 AM
> To: rsyslog-users
> Subject: Re: [rsyslog] forwarding server template?
>
>
> On Apr 7, 2012, at 5:24 AM, Rainer Gerhards wrote:
> >> I just wanted to add a new answer to this. If I am reading the
> queue
> >> configuration and some online examples right, then I have to put 4-5
> >> lines of queue configuration if I wanted a LinkedList queue for
> >> forwarding to a remote system. This really, really makes the case
> for
> >> defining a forwarding queue in a single place, as this gets very
> silly
> >>
> >> $WorkDirectory /var/spool/rsyslog/fwd-host1
> >> $ActionQueueFileName fwdHost1
> >> $ActionQueueMaxDiskSpace 1g
> >> $ActionQueueSaveOnShutdown on
> >> $ActionQueueType LinkedList
> >> $ActionResumeRetryCount -1
> >> if this and that then @@remoteHost1:514
> >>
> >> $WorkDirectory /var/spool/rsyslog/fwd-host2
> >> $ActionQueueFileName fwdHost2
> >> $ActionQueueMaxDiskSpace 1g
> >> $ActionQueueSaveOnShutdown on
> >> $ActionQueueType LinkedList
> >> $ActionResumeRetryCount -1
> >> if one and another then @@remoteHost2:514
> >>
> >> $WorkDirectory /var/spool/rsyslog/fwd-host1
> >> $ActionQueueFileName fwdHost1
> >> $ActionQueueMaxDiskSpace 1g
> >> $ActionQueueSaveOnShutdown on
> >> $ActionQueueType LinkedList
> >> $ActionResumeRetryCount -1
> >> if more and yetmore then @@remoteHost1:514
> >>
> >> Please please tell me I am misunderstanding and you can easily
> define a
> >> single queue on a per-host basis, no matter how many rules forward
> >> messages to that host.
>
> On Apr 7, 2012, at 5:24 AM, Rainer Gerhards wrote:
> > You are understanding it right ;) The plan is to include named
> actions in v6,
> > which will solve this issue. Anyhow, patches are always welcome.
>
>
> This is perhaps the one thing I understand the least, and I'm looking
> forward to your changes. For now, is the best practice for this to put
> each queue inside a separate file, put the ActionQueue directives at
> the top and put every rule that forwards to that host within the same
> file? Like

Let me try to explain. Please bear with me, as I am so involved with the code
that I may think of something as being "natural" where it isn't.

Let's assume the queue params for a while so that we don't clutter things.
First of all

*.* @@host.example.net #action 1
*.* @@host.example.net #action 2

Means there are TWO forwarding actions, that is if both rules match
(obviously they do in this example), TWO connections to host.example.net are
created. Each of this connections (actually actions) uses their own queue
settings.

If you really want to have a single connection, things get ugly with the
current engine. To do that, you either use a single filter and a single
action, what often is extremely inconvenient. As a work-around, you can use
ruleset inclusion via omrulset[1]. In essence, then a ruleset is defined
which contains the forwarding action like

$ruleset fwd-host
*.* @@host.example.net #action 1

And in the other ruleset, a reference to it is used:
$ruleset whatever
$ActionOmrulesetRulesetName fwd-host
*.* :omruleset:
$ActionOmrulesetRulesetName fwd-host
*.* :omruleset:

This will end up with a single connection and a single set of queue params
(to be set in ruleset fwd-host).

Why did I do it that way? Tried to make it as easy as possible? ;-) Of course
not. It is just that this method could be implemented within the limits of
the pre-v6 engine. Other methods would require a great deal of engine change,
including the config part. And while the config was/is really bad, there was
an even larger demand for new features, so that received priority over the
config. Finally, within v6, I have found some time to gradually improve on
the config. The action part has improved quite a lot in v6, but named actions
are still missing. With them, you do something along these lines:

*.* action(type="omfwd" target="host..." id="fwd-host" queue.param=...))
*.* action(use="fwd-host")

Note how the action is defined the action that contains "id" and re-used by
specifying "use=" in the second filter. This will result in a single action.

If you don't insist on a single queue/connection (and performance-wise this
is a smart idea, if it does not violate any constraints), the usual approach
is to have an include file that contains the queue parameters, like this:

queue-params.inc:
>
> /etc/rsyslog.conf:
> # Include all config files in /etc/rsyslog.d/
> $IncludeConfig /etc/rsyslog.d/*.conf
>
> /etc/rsyslog.d/fwd-host1.conf:
> $WorkDirectory /var/spool/rsyslog/fwd-host1
> $ActionQueueFileName fwdHost1
> $ActionQueueMaxDiskSpace 1g
> $ActionQueueSaveOnShutdown on
> $ActionQueueType LinkedList
> $ActionResumeRetryCount -1
>
> if this and that then @@remoteHost1:514
>
> if more and yetmore then @@remoteHost1:514
>
> if trimore then @@remoteHost1:514
>
> /etc/rsyslog.d/fwd-host2.conf:
> $WorkDirectory /var/spool/rsyslog/fwd-host2
> $ActionQueueFileName fwdHost2
> $ActionQueueMaxDiskSpace 1g
> $ActionQueueSaveOnShutdown on
> $ActionQueueType LinkedList
> $ActionResumeRetryCount -1
>
> if one and another then @@remoteHost2:514
>
> Will that work making it easy to maintain a single queue for each
> remote host?

If you don't insist on a single queue/connection (and performance-wise this
is a smart idea, if it does not violate any constraints), the usual approach
is to have an include file that contains the queue parameters, like this:

/etc/rsyslog.d/queue-params.inc:
$ActionQueueMaxDiskSpace 1g
$ActionQueueSaveOnShutdown on
$ActionQueueType LinkedList
$ActionResumeRetryCount -1

Note that the queue file name is NOT common!

/etc/rsyslog.conf:
# Include all config files in /etc/rsyslog.d/
$IncludeConfig /etc/rsyslog.d/*.conf
$WorkDirectory /var/spool/rsyslog/
$ActionQueueFileName fwd1
$includeConfig /etc/rsyslog.d/queue-params.inc
*.* @@host.example.net
$ActionQueueFileName fwd2
$includeConfig /etc/rsyslog.d/queue-params.inc
*.* @@host.example.net
And you can also use the same include if you want to use the same params for
some other host:
$ActionQueueFileName fwd3
$includeConfig /etc/rsyslog.d/queue-params.inc
*.* @@otherhost.example.net

Again, the prime reason for things being as they are is that this way it fits
into the old-style config constraints. In v6, you specify the queue params
inside the scoped action statement, which makes things much more readable.

I hope this clarifies.

Rainer

[1] http://www.rsyslog.com/doc/omruleset.html
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/


jrhett at netconsonance

Apr 10, 2012, 11:15 AM

Post #13 of 13 (419 views)
Permalink
Re: forwarding server template? [In reply to]

On Apr 9, 2012, at 11:58 PM, Rainer Gerhards wrote:
> Let me try to explain. Please bear with me, as I am so involved with the code
> that I may think of something as being "natural" where it isn't.

Thanks for the detailed explanation. This makes a lot of sense now that you've broken it out.

--
Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source and other randomness

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/

RSyslog users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.