tags:

views:

48

answers:

1

I use the following two commands to see my tables from binlogs.

mysqlbinlog mysql-bin.000016 | awk '/session/,/;/' | more

mysqlbinlog mysql-bin.000016 | awk '/session_log/,/;/' | more

How do I see both the table lines in a single statement?

+1  A: 

I think what you need is:

mysqlbinlog mysql-bin.000016 | awk '/session(_log)?/,/;/' | more

Use '?' to show that '_log' is option so with or without it.

NawaMan
This is very useful.But my table names can be anything. (like abc, pqrst)And I want to see around 5 tables at a time.
shantanuo
So use | = or like this: '(name1|name2|name3|name4|name5)'. :-D
NawaMan
Yes. This is what I was looking for. But is it possible to group the queries of each table together? I mean is it possible to find name1 first and then name2, name3 after that and name4 last?
shantanuo
No. As far as I know. You may need to select it one by one and combine them.
NawaMan