智能日志管理平台

  • 按 mysql 慢请求日志解析

    最近更新时间:2018-07-09 22:11:07

    mysql log 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"
        }
      ]
    }
    
    以上内容是否对您有帮助?
  • Close