2019-01-21 gd swarm3安装ripgrep——使

2019-01-21  本文已影响9人  五大RobertWu伍洋

尝试使用centos 7的方式在gd swarm3安装,失败了:

sudo yum-config-manager --add-repo=https://copr.fedorainfracloud.org/coprs/carlwgeorge/ripgrep/repo/epel-7/carlwgeorge-ripgrep-epel-7.repo

sudo yum install ripgrep

使用通用linux方式安装,成功! :

wget  https://github.com/BurntSushi/ripgrep/releases/download/0.10.0/ripgrep-0.10.0-x86_64-unknown-linux-musl.tar.gz

tar xzvf ripgrep-0.10.0-x86_64-unknown-linux-musl.tar.gz

sudo cp ripgrep-0.10.0-x86_64-unknown-linux-musl/rg  /usr/local/bin/

使用rg对日志过滤和统计(如下来自历史命令列表):

342  rg --count-matches "MomoChat" |awk  'BEGIN{FS=":"}{print $2}'|tr -s "\n" "+"
  343  rg --count-matches "media_id=102" |awk  'BEGIN{FS=":"}{print $2}'|tr -s "\n" "+"
  345  rg --count-matches "media_id=102" ../20190119|awk  'BEGIN{FS=":"}{print $2}'|tr -s "\n" "+"
351  rg --count-matches "media_id=102" |awk  'BEGIN{FS=":"}{print $2}'|tr -s "\n" "+"
354  rg -m1  "media_id=102" 2019012010.txt
上一篇下一篇

猜你喜欢

热点阅读