2

I have a large slow query log file. i want to check the queries of a particular date in last week. Its very tough to scan the file and go the particular date.

Is there any command to extract the slow log queries of a particular date from that large file ?

Any linux command or something..

Thanks

Aman Aggarwal
  • 17,619
  • 9
  • 53
  • 81

1 Answers1

2

pt-query-digest has --since and --until. Reference.

And the default output will display the 'worst' queries first.

(See Comments for further tips.)

Rick James
  • 135,179
  • 13
  • 127
  • 222
  • 1
    You can also dump the output of the excerpt in raw slow-log format instead of the usual digest report by using the `--output slowlog` option. – Bill Karwin Nov 16 '16 at 18:35
  • 1
    Minor enhancement to Bill's comment, using `--output slowlog --no-report` displays _only_ the slow log. – abchk1234 Oct 31 '18 at 11:38