New Forum system requires email address which you used to apply for your account to replace your original username. Password stays the same.Please see this post for more details

Yealink Test Club has been officially launched. Please visit post below to get detail information. Come and join us!

We just had the YMCS online and we are also working on the features plan on the future versions, in this regard we are need to hear your voice about the YMCS.
Please visit :

Post Reply 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Assign User management for Sites
Author Message
Dale2 Offline
Junior Member

Posts: 1
Joined: Apr 2019
Reputation: 0
Post: #2
Change date format with awk
I have a log file, I'm trying to reformat using sed/awk/grep but running into difficulties with the date format. The log looks like this: - - [28/Mar/2019:11:43:58 +0000] "GET /e9bb2dddd28b/ HTTP/1.1" "-" "Yealink W52P 00:00:00:00:00:00" 404 - 1 5 0.146
I would like the output as so:

Yealink,,28-03-2019 11:43:58
I have tried the following:

grep Yealink access.log | grep 404 | sed 's/\[//g' | awk '{print "Yealink,",$1,",",strftime("%Y-%m-%d %H:%M:%S", $4)}' | sed 's/, /,/g' | sed 's/ ,/,/g'
edit - removing [ before passing date string to strftime based on comments - but still not working as expected UPSers

However this returns a null date - so clearly I have the strftime syntax wrong:

Yealink,,1970-01-01 01:00:00
(This post was last modified: 04-20-2019 04:29 AM by Dale2.)
04-19-2019 05:48 AM
Find all posts by this user    like0    dislike0 Quote this message in a reply
Post Reply 

Messages In This Thread
Assign User management for Sites - ysvn - 11-14-2018, 02:05 AM
Change date format with awk - Dale2 - 04-19-2019 05:48 AM

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [FAQ] The phones can't connect to Yealink Device Management Platform(YDMP) Karl_Yealink 3 2,770 05-29-2019 12:14 PM
Last Post: chrisver
  Possibility to disable call forward management from IPPhone ? julien250889 1 404 05-15-2019 11:05 AM
Last Post: Jensen_Yealink
  Zoom Phone support with Yealink Device Management Platform avshch 0 174 04-06-2019 10:40 AM
Last Post: avshch
  Yealink Device Management Platform support for SAML SSO avshch 0 150 04-06-2019 10:30 AM
Last Post: avshch
  Remote phone management superioritsolutions 1 858 09-06-2018 09:45 PM
Last Post: gotelusa

Forum Jump:

User(s) browsing this thread: 1 Guest(s)

Contact Us   Yealink   Return to Top   Return to Content   Lite (Archive) Mode   RSS Syndication