Hi all,
I'm trying to modify the Syslog timestamp format with no luck.
This is the current timestamp format of my ESXi Syslog:
2019-08-05T12:59:01.669+02:00 info hostd[03469] [Originator@6876 sub=Dispatcher] Tag dispatcher configuration : /etc/vmware/hostd/dispatcher.xml
Could they be modified to, i.e, look like the following?(Other default timestamps may also be useful)
2019 Aug 05 13:01:02 info hostd[03469] [Originator@6876 sub=Dispatcher] Tag dispatcher configuration : /etc/vmware/hostd/dispatcher.xml
A big greeting to the VMware team, Juan Pablo Sáez
You can use awk command on relevant log and redirect to new log file based on the format of your interest.
Something like this:
awk '{getDate="date -j -f \"%b %d %H:%M:%S\" \""$1" "$2" "$3"\" \"+%Y%m%d %H:%M:%S\""
while ( ( getDate | getline date ) > 0 ) { }
close(getDate);
print date,$2,$3,$4,$5}' Log1 > Log2
---------------------------------------------------------------------------------------------------------
Was it helpful? Let us know by completing this short survey here.
This can't be modified.
Thanks for your quick response. Could you open an issue to include this feature in future versions?
Greetings
I am not a VMware employee, so no. You will have to open and SR to do that.
OK, I get it, thank you very much. My problem here is that I haven't purchased the product and I'm not able to open SR tickets.
Greetings, Juan Pablo Sáez
You can use awk command on relevant log and redirect to new log file based on the format of your interest.
Something like this:
awk '{getDate="date -j -f \"%b %d %H:%M:%S\" \""$1" "$2" "$3"\" \"+%Y%m%d %H:%M:%S\""
while ( ( getDate | getline date ) > 0 ) { }
close(getDate);
print date,$2,$3,$4,$5}' Log1 > Log2
---------------------------------------------------------------------------------------------------------
Was it helpful? Let us know by completing this short survey here.