LoginSignup
0
1

More than 5 years have passed since last update.

nginxなどのログでステータスコードをハイライトしながらtailする

Posted at

nginxなどのログでステータスコードをハイライトしながらtailする

下の例では 2xx 以外のステータスコード(例では3桁の数字で両端にスペースがある文字列)をハイライトできる。

less -p " [0-1,3-9]{1}[0-9]{2} " /opt/nginx/logs/access.log

lessコマンドが起動したら、 F を押して tail -F のような挙動にする。
終了する際は Ctrl+c -> q

0
1
1

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
0
1