LoginSignup
11
8

More than 5 years have passed since last update.

awkで特定の条件にマッチした行を表示

Last updated at Posted at 2014-10-16

例えばアクセスログに出力されているレスポンスタイム(ms)が1000ms以上のものを表示する場合。
(レスポンスタイムが4column目に出されている場合)

$ awk '{FS="\t"; if($4 > 1000){print $0}}' target.log

タブ区切りでなければFS="\t"は除去してOK。
$0は行全体を表示。

11
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
8