[Gllug] rsyslog time format

Konrad Vrba konrad.vrba at gmail.com
Mon Jun 27 17:05:20 UTC 2011


thank you Vaidas,
I had to modify it a little, but now it works. The correct template
definition is:

$template MySuperAwesomeTimestamps,"%$NOW% %msg%\n"

regards,
Konrad

On Sat, Jun 25, 2011 at 11:27 PM, Vaidas Jablonskis <jablonskis at gmail.com>wrote:

> Hi Konrad,
>
> You can create a template and then apply it to a message. For example:
>
> # define a template
> $template MySuperAwesomeTimestamps,"$NOW %msg%"
>
> # apply the template
> authpriv.*
> /var/log/secure;MySuperAwesomeTimestamps
>
> $NOW will generate YYYY-MM-DD. The above syntax might be incorrect as I
> cannot remember it off hand, but I hope it gives you an idea.
>
> Thanks,
> Vaidas
>
>
> On 24 June 2011 13:40, Konrad Vrba <konrad.vrba at gmail.com> wrote:
>
>> hello,
>> at the moment my rsyslog generates logs with time stamp in the form:
>> Jun 24 14:03:33 ............
>>
>> I would like to change the date format to
>> YYYY-MM-DD 14:03:33 ............
>>
>> In the rsyslog.conf file, I see the option to enable high precision
>> timestamps. But this is not what I need. I do not need miliseconds time
>> stamps. I need year timestamps
>>
>> Could sombody please advise how to do this ?
>>
>> regards,
>> konrad
>>
>> --
>> Gllug mailing list  -  Gllug at gllug.org.uk
>> http://lists.gllug.org.uk/mailman/listinfo/gllug
>>
>>
>
>
> --
> Vaidas Jablonskis
>
>
> --
> Gllug mailing list  -  Gllug at gllug.org.uk
> http://lists.gllug.org.uk/mailman/listinfo/gllug
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20110627/a8604889/attachment.html>
-------------- next part --------------
--
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list