https://github.com/tkuchiki/mysqlslowlog-unixtime2datetime
Convert a unixtime to datetime(mysql slowlog).
https://github.com/tkuchiki/mysqlslowlog-unixtime2datetime
Last synced: 3 months ago
JSON representation
Convert a unixtime to datetime(mysql slowlog).
- Host: GitHub
- URL: https://github.com/tkuchiki/mysqlslowlog-unixtime2datetime
- Owner: tkuchiki
- License: mit
- Created: 2014-10-06T07:47:58.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-06T09:38:41.000Z (over 10 years ago)
- Last Synced: 2025-01-25T09:11:06.549Z (5 months ago)
- Language: Go
- Size: 129 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
mysqlslowlog-unixtime2datetime
==============================Convert a unixtime to datetime(mysql slowlog).
## Example
~~~~
$ cat mysqlslow.log
/rdsdbbin/mysql/bin/mysqld, Version: 5.6.17-log (MySQL Community Server (GPL)). started with:
Tcp port: 3306 Unix socket: /tmp/mysql.sock
Time Id Command Argument
# Time: 141005 13:05:00
# User@Host: hoge[hoge] @ [192.168.0.10] Id: 7859392
# Query_time: 0.212722 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
use hoge;
SET timestamp=1412514300;
commit;
# User@Host: rdsadmin[rdsadmin] @ localhost [127.0.0.1] Id: 916375
# Query_time: 0.393160 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
use mysql;
SET timestamp=1412514300;
flush logs;
# User@Host: hoge[hoge] @ [192.168.0.10] Id: 7880380
# Query_time: 0.383446 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
use hoge;
SET timestamp=1412514300;
commit;
~~~~~~~~
$ go run mysqlslowlog-unixtime2datetime.go mysqlslow.log
/rdsdbbin/mysql/bin/mysqld, Version: 5.6.17-log (MySQL Community Server (GPL)). started with:
Tcp port: 3306 Unix socket: /tmp/mysql.sock
Time Id Command Argument
# Time: 141005 13:05:00
# User@Host: hoge[hoge] @ [192.168.0.10] Id: 7859392
# Query_time: 0.212722 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
use hoge;
SET timestamp=1412514300; (2014-10-05 22:05:00 +0900 JST)
commit;
# User@Host: rdsadmin[rdsadmin] @ localhost [127.0.0.1] Id: 916375
# Query_time: 0.393160 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
use mysql;
SET timestamp=1412514300; (2014-10-05 22:05:00 +0900 JST)
flush logs;
# User@Host: hoge[hoge] @ [192.168.0.10] Id: 7880380
# Query_time: 0.383446 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
use hoge;
SET timestamp=1412514300; (2014-10-05 22:05:00 +0900 JST)
commit;
~~~~