Page 1 of 1

Logging microseconds? us= numbers

Posted: Wed Jul 13, 2022 6:18 pm
by wc
I was reviewing my logs and thought they looked a little noisy.....

Jul 13 13:11:04 asdf openvpn: Wed Jul 13 13:11:04 2022 us=429137 dddd/72.8.1.1:59385 Outgoing Data Channel: Using 160 bit message hash 'SHA1' for HMAC authentication
Jul 13 13:11:04 asdf openvpn: Wed Jul 13 13:11:04 2022 us=429217 dddd/72.8.1.1:59385 Incoming Data Channel: Cipher 'BF-CBC' initialized with 128 bit key
Jul 13 13:11:04 asdf openvpn: Wed Jul 13 13:11:04 2022 us=429235 dddd/72.8.1.1:59385 WARNING: blahblah

How do I prevent the duplicate timestamp?
How do I suppress the us= field (logging microseconds)?

Are those microseconds since the logged action started? Or the duration that logged action took? Or is it meant as a decimal after the second field of the timestamp, 04 in this example?

[SOLVED] Re: Logging microseconds? us= numbers

Posted: Wed Jul 13, 2022 6:43 pm
by wc
Maybe solved my own problem:
referencing https://medium.com/@Dylan.Wang/enable-o ... dd7bb186b8 I found my systemd script

find /etc/systemd | grep vpn
exited the Exec line to add "--suppress-timestamps" as the first arg
then ran
# systemctl daemon-reload
# systemctl restart <servicname>

(servicename was the basename of file that I edited)

I'm a little disappointed that I couldn't make this change in a conf file, but oh well. And suppressing it made the us= statements go away, implying they were a decimal after the second place.

Re: Logging microseconds? us= numbers

Posted: Wed Jul 13, 2022 6:46 pm
by TinCanTech
You can use --suppress-timestamps and/or --machine-readable-output

Re: Logging microseconds? us= numbers

Posted: Wed Jul 13, 2022 6:58 pm
by TinCanTech
wc wrote:
Wed Jul 13, 2022 6:43 pm
I'm a little disappointed that I couldn't make this change in a conf file
You can ..