Trying to isolate pt-query-digest to the host

I am having difficulty with the correct syntax to pull out specific host information for my slow query log file:

I am using the following:

sudo pt-query-digest mysql-slow.log --since "2017-05-07 22:00:00" --until "2017-05-08 22:00:00" --filter ‘$event->{host} !~ m/^ip-1-1-1-1/’ > slow.log

In this scenario, I am trying to exclude all IP addresses that are 1.1.1.1. I can’t understand what happened.

+6
source share
1 answer

Use ascii quote ('), not this non-ascii quote (');

Assuming that m/^ip-1-1-1-1/works, it will capture both ip-1-1-1-1, and ip-1-1-1-123. Therefore, you may need something to interrupt ip. Maybe,m/^ip-1-1-1-1$/

arg , ( ) $event , {...} - !~ .

+2

Source: https://habr.com/ru/post/1017090/


All Articles