- 
                Notifications
    
You must be signed in to change notification settings  - Fork 262
 
mysqllog parser
        Sun Jianbo edited this page Mar 11, 2018 
        ·
        1 revision
      
    mysqllog parser 解析的是mysql的慢请求日志。
针对如下一条慢请求日志:
# Time: 2017-12-24T02:42:00.126000Z
# User@Host: rdsadmin[rdsadmin] @ localhost [127.0.0.1]  Id:     3
# Query_time: 0.020363  Lock_time: 0.018450 Rows_sent: 0  Rows_examined: 1
SET timestamp=1514083320;
use foo;
SELECT count(*) from mysql.rds_replication_status WHERE master_host IS NOT NULL and master_port IS NOT NULL GROUP BY action_timestamp,called_by_user,action,mysql_version,master_host,master_port ORDER BY action_timestamp LIMIT 1;
可以解析得到的数据为:
{
  "SamplePoints": [
    {
      "Database": "foo",
      "Host": "localhost",
      "Lock_time": 0.01845,
      "Query_time": 0.020363,
      "Rows_examined": 1,
      "Rows_sent": 0,
      "Statement": "SELECT count(*) from mysql.rds_replication_status WHERE master_host IS NOT NULL and master_port IS NOT NULL GROUP BY action_timestamp,called_by_user,action,mysql_version,master_host,master_port ORDER BY action_timestamp LIMIT 1;",
      "Timestamp": "2017-12-24T02:42:00Z",
      "User": "rdsadmin"
    }
  ]
}
    "parser":{
        "type":"mysqllog",
        "labels":"machine nb110,team pandora"
    },
- 
labels记录标签,选填。 
快速开始 | Pandora | Readers | Parsers | Senders | Download | 七牛智能日志管理平台 | logkit-pro专业版