首页 > pt-query-digest 使用 since 参数的时候,总是提示 No events processed

pt-query-digest 使用 since 参数的时候,总是提示 No events processed

tony@ubuntu:~/demo$ pt-query-digest slow.log --filter '$event->{fingerprint} =~ m/^select/i' --since='2016-01-01'

# No events processed.
tony@ubuntu:~/demo$ 

已经加了一个 event,已经确定日志里有该日期以后的数据了。
看了 官方文档,说:

--since
type: string

Parse only queries newer than this value (parse queries since this date).

This option allows you to ignore queries older than a certain value and parse only those queries which are more recent than the value. The value can be several types:

* Simple time value N with optional suffix: N[shmd], where
  s=seconds, h=hours, m=minutes, d=days (default s if no suffix
  given); this is like saying "since N[shmd] ago"
* Full date with optional hours:minutes:seconds:
  YYYY-MM-DD [HH:MM:SS]
* Short, MySQL-style date:
  YYMMDD [HH:MM:SS]
* Any time expression evaluated by MySQL:
  CURRENT_DATE - INTERVAL 7 DAY
If you give a MySQL time expression, and you have not also specified a DSN for --explain, --processlist, or --review, then you must specify a DSN on the command line so that pt-query-digest can connect to MySQL to evaluate the expression.

The MySQL time expression is wrapped inside a query like “SELECT UNIX_TIMESTAMP(<expression>)”, so be sure that the expression is valid inside this query. For example, do not use UNIX_TIMESTAMP() because UNIX_TIMESTAMP(UNIX_TIMESTAMP()) returns 0.

Events are assumed to be in chronological: older events at the beginning of the log and newer events at the end of the log. --since is strict: it ignores all queries until one is found that is new enough. Therefore, if the query events are not consistently timestamped, some may be ignored which are actually new enough.

See also --until.

但还是没解决问题。
因为网上有很多例子都是这么写的,所以很郁闷。

【热门文章】
【热门文章】