MySQL slow log intercept time period

Source: Internet
Author: User

Perform mysqldumpslow–h to view help information. Main introduction Two parameters-S and-t
-S This is a sort parameter, optional:
Al: Average lockout time
AR: Average number of returned records
At: Average query time
C: Count
L: Lockout time
R: Return record
T: Query time
-T n Display header N Records
###########################
You typically need to see the log information for a time period:

awk '/# time:2017-10-30t20/,/# time:2017-10-31t03/' query-slow.log_42_20171031 >/tmp/a_log

awk '/# time: ' 110223 '/,/# time: ' 110224 '/' slow.log take out a day's data

awk '/# time: ' 110303 ' 1 '/,/# time: ' 110303 ' 2 '/' Slow.log take out 3rd points to 2 point data

awk '/# time: ' 110303 ' 1 '/,/# time: ' 110303 ' a '/' slow.log can take out all data after 1 points

awk '/# time: ' 140701 '/,/# time: ' 140703 '/' Slow.log

awk '/# time: ' 140703 ' 9 '/,/# time: ' 110303 ' a '/'

MySQL slow log intercept time period

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.