VMware Cloud Community
Zenid
Contributor
Contributor
Jump to solution

Changing Timestamp format in 6.x ESXI Syslog

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

Tags (2)
1 Solution

Accepted Solutions
SatyS
Hot Shot
Hot Shot
Jump to solution

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.

If you find this useful,please mark the answer as correct/helpful Regards, SatyS http://myvirtuallearning.wordpress.com/

View solution in original post

5 Replies
daphnissov
Immortal
Immortal
Jump to solution

This can't be modified.

Zenid
Contributor
Contributor
Jump to solution

Thanks for your quick response. Could you open an issue to include this feature in future versions?

Greetings

Reply
0 Kudos
daphnissov
Immortal
Immortal
Jump to solution

I am not a VMware employee, so no. You will have to open and SR to do that.

Reply
0 Kudos
Zenid
Contributor
Contributor
Jump to solution

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

Reply
0 Kudos
SatyS
Hot Shot
Hot Shot
Jump to solution

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.

If you find this useful,please mark the answer as correct/helpful Regards, SatyS http://myvirtuallearning.wordpress.com/