The system call that bash, etc uses to sort/read/list the .d/*.conf files 
utilizes the language and locale of the system.   So, if you have systems that 
differ in these settings, it would be beneficial to understand the different 
sorting/reading/listing of the config files.

Here is an example of how you can test on one machine for the differences.

# env |egrep '^LC|^LANG'
LANG=en_US.UTF-8

# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=


Using en_US results in the following:

# LC_ALL=en_US sort 
<<<$'zz-MY_FILE.conf\nZZ-MY_FILE.conf\n91-MY_FILE.conf\n99-MY_FILE.conf\n99--MY_FILE.conf\n9-MY_FILE.conf\nZZZ-MY_FILE.conf\n99--1MY_FILE.conf\n999-MY_FILE.conf'
91-MY_FILE.conf
99--1MY_FILE.conf
999-MY_FILE.conf
99--MY_FILE.conf
99-MY_FILE.conf
9-MY_FILE.conf
zz-MY_FILE.conf
ZZ-MY_FILE.conf
ZZZ-MY_FILE.conf

Using C results in the following:

# LC_ALL=C sort 
<<<$'zz-MY_FILE.conf\nZZ-MY_FILE.conf\n91-MY_FILE.conf\n99-MY_FILE.conf\n99--MY_FILE.conf\n9-MY_FILE.conf\nZZZ-MY_FILE.conf\n99--1MY_FILE.conf\n999-MY_FILE.conf'
9-MY_FILE.conf
91-MY_FILE.conf
99--1MY_FILE.conf
99--MY_FILE.conf
99-MY_FILE.conf
999-MY_FILE.conf
ZZ-MY_FILE.conf
ZZZ-MY_FILE.conf
zz-MY_FILE.conf


-----Original Message-----
From: rsyslog <[email protected]> On Behalf Of Rainer Gerhards 
via rsyslog
Sent: Thursday, July 22, 2021 12:20 PM
To: rsyslog-users <[email protected]>
Cc: Rainer Gerhards <[email protected]>; Abdulaziz Loonat 
<[email protected]>
Subject: Re: [rsyslog] order of conf files processed

* PROCEED WITH CAUTION - This email was sent from outside the Company *




just like bash does - we use the same system call. So ls -l will show you the 
order.

Rainer

El jue, 22 jul 2021 a las 19:13, John Chivian via rsyslog
(<[email protected]>) escribió:
>
> I admit I am not sure about the exact logic implemented, but if you
> do…
>
> rsyslogd -o ./rsyslog.config.out
>
> …it’ll show you how the files in your configuration were processed.
>
> Regards,
>
>
>
> > On Jul 22, 2021, at 11:19, Abdulaziz Loonat via rsyslog 
> > <[email protected]> wrote:
> >
> > what order are conf file processed in /etc/rsyslog.d
> >
> > is it numeric then a-z or other way round
> > _______________________________________________
> > rsyslog mailing list
> > https://protect2.fireeye.com/v1/url?k=fc758a22-a3eeb368-fc75c9dd-0cc
> > 47ad9c190-2fcc637dcd809573&q=1&e=db8f5218-4a98-4039-93b8-47ff088c272
> > 0&u=https%3A%2F%2Flists.adiscon.net%2Fmailman%2Flistinfo%2Frsyslog
> > https://protect2.fireeye.com/v1/url?k=2c4f06a6-73d43fec-2c4f4559-0cc
> > 47ad9c190-16eedc3e3f80e478&q=1&e=db8f5218-4a98-4039-93b8-47ff088c272
> > 0&u=http%3A%2F%2Fwww.rsyslog.com%2Fprofessional-services%2F
> > 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://protect2.fireeye.com/v1/url?k=6cd91c7e-33422534-6cd95f81-0cc47
> ad9c190-4030d6d034cf658c&q=1&e=db8f5218-4a98-4039-93b8-47ff088c2720&u=
> https%3A%2F%2Flists.adiscon.net%2Fmailman%2Flistinfo%2Frsyslog
> https://protect2.fireeye.com/v1/url?k=23fbfd03-7c60c449-23fbbefc-0cc47
> ad9c190-33cd46656e5376f8&q=1&e=db8f5218-4a98-4039-93b8-47ff088c2720&u=
> http%3A%2F%2Fwww.rsyslog.com%2Fprofessional-services%2F
> 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://protect2.fireeye.com/v1/url?k=ae228644-f1b9bf0e-ae22c5bb-0cc47ad9c190-a9d5c9fed8d63b02&q=1&e=db8f5218-4a98-4039-93b8-47ff088c2720&u=https%3A%2F%2Flists.adiscon.net%2Fmailman%2Flistinfo%2Frsyslog
https://protect2.fireeye.com/v1/url?k=becbe25b-e150db11-becba1a4-0cc47ad9c190-848bd5609c4b9fbd&q=1&e=db8f5218-4a98-4039-93b8-47ff088c2720&u=http%3A%2F%2Fwww.rsyslog.com%2Fprofessional-services%2F
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.
This email and any attachments may contain information that is confidential 
and/or privileged for the sole use of the intended recipient. Any use, review, 
disclosure, copying, distribution or reliance by others, and any forwarding of 
this email or its contents, without the express permission of the sender is 
strictly prohibited by law. If you are not the intended recipient, please 
contact the sender immediately, delete the e-mail and destroy all copies.
_______________________________________________
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