Mailing List Archive

noob problen configuring rsyslog
Hi all,

sadly .... im facing a problem to very basic configuration in rsyslog.
im using the well known message and path formats, so special stuff ....

but:
when im changing any path for logs, such as /var/log/messages to one
with variables such as /var/log/%HOSTNAME%/messages the logs will occur
under a path '%HOSTNAME%' not the exceted "localhost.localdomain"

Sorry ascing this, but in did not find any hint on such error while
googling.

thanks a lot for helping (hopefully)
Michael



_______________________________________________
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.
Re: noob problen configuring rsyslog [ In reply to ]
I guess I know what you mean, but can you post a config snippet with
this configuration?

Rainer

El sáb., 21 nov. 2020 a las 11:41, Michael Musiol via rsyslog
(<rsyslog@lists.adiscon.com>) escribió:
>
> Hi all,
>
> sadly .... im facing a problem to very basic configuration in rsyslog.
> im using the well known message and path formats, so special stuff ....
>
> but:
> when im changing any path for logs, such as /var/log/messages to one
> with variables such as /var/log/%HOSTNAME%/messages the logs will occur
> under a path '%HOSTNAME%' not the exceted "localhost.localdomain"
>
> Sorry ascing this, but in did not find any hint on such error while
> googling.
>
> thanks a lot for helping (hopefully)
> Michael
>
>
>
> _______________________________________________
> 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.
_______________________________________________
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.
Re: noob problen configuring rsyslog [ In reply to ]
Im using in rsyslog.conf the simplest possible change:

##### RULES #####
*.info;mail.none; ....... /var/log/%HOSTNAME%/mm_messages

with "ls /var/log/"
i find the directory %Hostname%, witihn there the logfile.

screenshots attached






Mit freundlichem Gruß,
Michael



------ Originalnachricht ------
Von: "Rainer Gerhards" <rgerhards@hq.adiscon.com>
An: "Michael Musiol" <mic@mdmm.de>; "rsyslog-users"
<rsyslog@lists.adiscon.com>
Gesendet: 21.11.2020 11:51:42
Betreff: Re: [rsyslog] noob problen configuring rsyslog

>I guess I know what you mean, but can you post a config snippet with
>this configuration?
>
>Rainer
>
>El sáb., 21 nov. 2020 a las 11:41, Michael Musiol via rsyslog
>(<rsyslog@lists.adiscon.com>) escribió:
>>
>> Hi all,
>>
>> sadly .... im facing a problem to very basic configuration in rsyslog.
>> im using the well known message and path formats, so special stuff ....
>>
>> but:
>> when im changing any path for logs, such as /var/log/messages to one
>> with variables such as /var/log/%HOSTNAME%/messages the logs will occur
>> under a path '%HOSTNAME%' not the exceted "localhost.localdomain"
>>
>> Sorry ascing this, but in did not find any hint on such error while
>> googling.
>>
>> thanks a lot for helping (hopefully)
>> Michael
>>
>>
>>
>> _______________________________________________
>> 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.
Re: noob problen configuring rsyslog [ In reply to ]
Hello Michael,

you have to define a template and use the correct syntax for dynafiles.

Example (old syntax):

$template DynafileTemplate,"/var/log/%HOSTNAME%/mm_messages"
.info;mail.none ?DynafileTemplate

Example (new, preferred syntax):

template (name="DynafileTemplate" type="string"
string="/var/log/%HOSTNAME%/mm_messages")
.info;mail.none action(type="omfile" dynafile="DynafileTemplate"
sync="on" ioBufferSize="64k" Template="RSYSLOG_TraditionalFileFormat")

Regards
und freundlicher Gruß

Ansgar

Am 21.11.2020 um 16:07 schrieb Michael Musiol via rsyslog:
>
>
> Im using in rsyslog.conf the simplest possible change:
>
> ##### RULES #####
> *.info;mail.none; .......      /var/log/%HOSTNAME%/mm_messages
>
> with "ls /var/log/"
> i find the directory %Hostname%, witihn there the logfile.
>
> screenshots attached
>
>
>
>
>
>
> Mit freundlichem Gruß,
> Michael
>
>
>
> ------ Originalnachricht ------
> Von: "Rainer Gerhards" <rgerhards@hq.adiscon.com>
> An: "Michael Musiol" <mic@mdmm.de>; "rsyslog-users"
> <rsyslog@lists.adiscon.com>
> Gesendet: 21.11.2020 11:51:42
> Betreff: Re: [rsyslog] noob problen configuring rsyslog
>
>> I guess I know what you mean, but can you post a config snippet with
>> this configuration?
>>
>> Rainer
>>
>> El sáb., 21 nov. 2020 a las 11:41, Michael Musiol via rsyslog
>> (<rsyslog@lists.adiscon.com>) escribió:
>>>
>>>  Hi all,
>>>
>>>  sadly .... im facing a problem to very basic configuration in rsyslog.
>>>  im using the well known message and path formats, so special stuff ....
>>>
>>>  but:
>>>  when im changing any path for logs, such as /var/log/messages to one
>>>  with variables such as  /var/log/%HOSTNAME%/messages the logs will
>>> occur
>>>  under a path '%HOSTNAME%'  not the exceted "localhost.localdomain"
>>>
>>>  Sorry ascing this, but in did not find any hint on such error while
>>>  googling.
>>>
>>>  thanks a lot for helping (hopefully)
>>>  Michael
>>>
>>>
>>>
>>>  _______________________________________________
>>>  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.
>
> _______________________________________________
> 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.
>

_______________________________________________
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.
Re: noob problen configuring rsyslog [ In reply to ]
El sáb., 21 nov. 2020 a las 16:07, Michael Musiol (<mic@mdmm.de>) escribió:
>
>
>
> Im using in rsyslog.conf the simplest possible change:
>
> ##### RULES #####
> *.info;mail.none; ....... /var/log/%HOSTNAME%/mm_messages

That's what I thought. This is a bit wrong. You need to define a
template to be used for the file name - because the above could
actually mean the path literally.

Out of my head, I do not remember the old syntax, but you can
copy&paste the following in your config instead of that line:

template(name="filename" type="string" string="/var/log/%HOSTNAME%/mm_messages")
*.info;mail.none; ....... action(type="omfile" dynafile="filename")

HTH,
Rainer


>
> with "ls /var/log/"
> i find the directory %Hostname%, witihn there the logfile.
>
> screenshots attached
>
>
>
>
>
>
> Mit freundlichem Gruß,
> Michael
>
>
>
> ------ Originalnachricht ------
> Von: "Rainer Gerhards" <rgerhards@hq.adiscon.com>
> An: "Michael Musiol" <mic@mdmm.de>; "rsyslog-users"
> <rsyslog@lists.adiscon.com>
> Gesendet: 21.11.2020 11:51:42
> Betreff: Re: [rsyslog] noob problen configuring rsyslog
>
> >I guess I know what you mean, but can you post a config snippet with
> >this configuration?
> >
> >Rainer
> >
> >El sáb., 21 nov. 2020 a las 11:41, Michael Musiol via rsyslog
> >(<rsyslog@lists.adiscon.com>) escribió:
> >>
> >> Hi all,
> >>
> >> sadly .... im facing a problem to very basic configuration in rsyslog.
> >> im using the well known message and path formats, so special stuff ....
> >>
> >> but:
> >> when im changing any path for logs, such as /var/log/messages to one
> >> with variables such as /var/log/%HOSTNAME%/messages the logs will occur
> >> under a path '%HOSTNAME%' not the exceted "localhost.localdomain"
> >>
> >> Sorry ascing this, but in did not find any hint on such error while
> >> googling.
> >>
> >> thanks a lot for helping (hopefully)
> >> Michael
> >>
> >>
> >>
> >> _______________________________________________
> >> 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.
_______________________________________________
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.
Re: noob problen configuring rsyslog [ In reply to ]
and i forgot:
Centos 8.x

Mit freundlichem Gruß,
Michael



------ Originalnachricht ------
Von: "Rainer Gerhards" <rgerhards@hq.adiscon.com>
An: "Michael Musiol" <mic@mdmm.de>
Cc: "rsyslog-users" <rsyslog@lists.adiscon.com>
Gesendet: 21.11.2020 17:21:18
Betreff: Re: Re[2]: [rsyslog] noob problen configuring rsyslog

>El sáb., 21 nov. 2020 a las 16:07, Michael Musiol (<mic@mdmm.de>) escribió:
>>
>>
>>
>> Im using in rsyslog.conf the simplest possible change:
>>
>> ##### RULES #####
>> *.info;mail.none; ....... /var/log/%HOSTNAME%/mm_messages
>
>That's what I thought. This is a bit wrong. You need to define a
>template to be used for the file name - because the above could
>actually mean the path literally.
>
>Out of my head, I do not remember the old syntax, but you can
>copy&paste the following in your config instead of that line:
>
>template(name="filename" type="string" string="/var/log/%HOSTNAME%/mm_messages")
>*.info;mail.none; ....... action(type="omfile" dynafile="filename")
>
>HTH,
>Rainer
>
>
>>
>> with "ls /var/log/"
>> i find the directory %Hostname%, witihn there the logfile.
>>
>> screenshots attached
>>
>>
>>
>>
>>
>>
>> Mit freundlichem Gruß,
>> Michael
>>
>>
>>
>> ------ Originalnachricht ------
>> Von: "Rainer Gerhards" <rgerhards@hq.adiscon.com>
>> An: "Michael Musiol" <mic@mdmm.de>; "rsyslog-users"
>> <rsyslog@lists.adiscon.com>
>> Gesendet: 21.11.2020 11:51:42
>> Betreff: Re: [rsyslog] noob problen configuring rsyslog
>>
>> >I guess I know what you mean, but can you post a config snippet with
>> >this configuration?
>> >
>> >Rainer
>> >
>> >El sáb., 21 nov. 2020 a las 11:41, Michael Musiol via rsyslog
>> >(<rsyslog@lists.adiscon.com>) escribió:
>> >>
>> >> Hi all,
>> >>
>> >> sadly .... im facing a problem to very basic configuration in rsyslog.
>> >> im using the well known message and path formats, so special stuff ....
>> >>
>> >> but:
>> >> when im changing any path for logs, such as /var/log/messages to one
>> >> with variables such as /var/log/%HOSTNAME%/messages the logs will occur
>> >> under a path '%HOSTNAME%' not the exceted "localhost.localdomain"
>> >>
>> >> Sorry ascing this, but in did not find any hint on such error while
>> >> googling.
>> >>
>> >> thanks a lot for helping (hopefully)
>> >> Michael
>> >>
>> >>
>> >>
>> >> _______________________________________________
>> >> 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.

_______________________________________________
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.