[YMCS/YDMP Free Trial Program]Yealink would like to offer Free Trial Program of Yealink device management service for our current eligible customers. You can see the details below.
https://www.yealink.com/ydmp-freetrial-2020


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
  [FAQ] The phones can't connect to Yealink Device Management Platform(YDMP) Karl_Yealink 4 9,902 09-30-2020 04:29 PM
Last Post: bigjerv55
Lightbulb FAQ for Yealink Device Management Platform Paz_Yealink 2 1,405 09-27-2020 06:40 AM
Last Post: Paz_Yealink
  YMCS Searching by Multiple Sites logs user out jangliss 0 1,312 01-23-2020 06:47 PM
Last Post: jangliss
  Possibility to disable call forward management from IPPhone ? julien250889 1 2,538 05-15-2019 11:05 AM
Last Post: Jensen_Yealink
  Zoom Phone support with Yealink Device Management Platform avshch 0 1,735 04-06-2019 10:40 AM
Last Post: avshch
  Yealink Device Management Platform support for SAML SSO avshch 0 1,467 04-06-2019 10:30 AM
Last Post: avshch
  Remote phone management superioritsolutions 1 2,538 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