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
http://forum.yealink.com/forum/showthread.php?tid=40344

Yealink Test Club has been officially launched. Please visit post below to get detail information. Come and join us!
http://forum.yealink.com/forum/announcements.php?aid=18

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 : http://forum.yealink.com/forum/showthread.php?tid=42322


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:

1.2.3.4 - - [28/Mar/2019:11:43:58 +0000] "GET /e9bb2dddd28b/5.6.7.8/YL0000000000.rom HTTP/1.1" "-" "Yealink W52P 25.81.0.10 00:00:00:00:00:00" 404 - 1 5 0.146
I would like the output as so:

Yealink,1.2.3.4,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,1.2.3.4,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
  Possibility to disable call forward management from IPPhone ? julien250889 1 336 05-15-2019 11:05 AM
Last Post: Jensen_Yealink
  Zoom Phone support with Yealink Device Management Platform avshch 0 126 04-06-2019 10:40 AM
Last Post: avshch
  Yealink Device Management Platform support for SAML SSO avshch 0 105 04-06-2019 10:30 AM
Last Post: avshch
  [FAQ] The phones can't connect to Yealink Device Management Platform(YDMP) Karl_Yealink 2 2,529 02-01-2019 04:11 PM
Last Post: haroem
  Remote phone management superioritsolutions 1 804 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