[syslog-ng] Uniqid
Laszlo Szemere (lszemere)
Laszlo.Szemere at oneidentity.com
Tue Dec 3 07:53:44 UTC 2019
Hello,
I do not clearly understand when you say: "but when using it in the file name, the output was presented in hexadecimal"
It is always a good approach in an open source project to examine the code itself.
The UNIQID macro: https://github.com/syslog-ng/syslog-ng/blob/master/lib/template/macros.c#L600
The format_uint64_padded function: https://github.com/syslog-ng/syslog-ng/blob/master/lib/str-format.c#L136
According to this, the UNIQID macro is ALWAYS presented as a concatenation of hexadecimal numbers, not just in case of filenames.
Referring to the documentation: https://www.syslog-ng.com/technical-documents/doc/syslog-ng-premium-edition/6.0.18/administration-guide/20#global-use-uniqid
The UNIQID is just the combination of the HOSTID and the RCPTID macros, which can be easily expressed in the filename parameter manually. (The RCTPID has a base10 representation.)
Note1: Since UNIQID is a globally unique identifier for each message (as long as it do not overflow), with this config ALL of your messages are going into a different file. Is this really what you want to achieve?
Note2: We usually do not recommend to use the "use-uniqid()" option for load balancing purposes, since it has an extra overhead, and load balancing usually do not requires such a precision. Usually the "second" or the "millisecond" part of the message achieve the same thing.
Best regards,
Laci
________________________________________
From: syslog-ng <syslog-ng-bounces at lists.balabit.hu> on behalf of William Luiz Ribeiro Vasconcelos Da Silva <wsilva_ericsson at timbrasil.com.br>
Sent: Monday, December 2, 2019 21:52
To: syslog-ng at lists.balabit.hu
Subject: [syslog-ng] Uniqid
CAUTION: This email originated from outside of the organization. Do not follow guidance, click links, or open attachments unless you recognize the sender and know the content is safe.
Hello People,
I'm using the uniqid in my syslog-ng.conf , but when using it in the file name, the output was presented in hexadecimal, example: "8e99d7b2 at 000000000000040b.log"
How to convert the output to decimal because we have a balancer layer to collect files ending in even numbers and another layer for odd numbers.
This is part of syslog-ng.conf: "${HOST}_${YEAR}${MONTH}${DAY}${HOUR}${MIN}${SEC}_GMT${TZ}_${UNIQID}.log"
Tks
Esta mensagem, incluindo seus anexos, pode conter informações privilegiadas e/ou de caráter confidencial, não podendo ser retransmitida sem autorização do remetente. Se você não é o destinatário ou pessoa autorizada para recebê-la, informamos que o seu uso, divulgação, cópia ou arquivamento são proibidos. Portanto, se você recebeu esta mensagem por engano, por favor nos informe respondendo imediatamente a este e-mail e delete o seu conteúdo.
This message, including its attachments, may contain privileged or confidential information, and it must not be fowarded without the express authorization of the sender. If you are not the intended recipient, we hereby inform you that the use, disclosure, copy or filing are forbidden. So, if you received this message as a mistake, please inform us by answering this e-mail and deleting its contents
Questo messaggio, inclusi gli allegati, potrebbe contenere informazioni privilegiate e/o riservate, e non deve essere ritrasmesse senza l'autorizzazione del mittente. Se non siete il destinatario o la persona autorizzata a riceverlo, informiamo che il suo utilizzo, diffusione, copia o archiviazione sono proibite. Quindi, se avete ricevuto questo messaggio per errore, per cortesia ci informi rispondendo immediatamente a questa email e cancelli il suo contenuto
More information about the syslog-ng
mailing list