常用命令

40 阅读1分钟
alias gitpush="git push origin HEAD:refs/for/\`git branch --show-current\`"

grep -E "proctime:total:[0-9]{3,}" bill.log | head -n 30

cat bill.trace_log.sdf.log | awk -F "duration" '{print $2}' | awk -F ',' '{print $1}' | awk -F ':' '{if($2 > 1000) print $2}' | sort

grep "proctime:total:" genquery.log.2021080216_1 | awk -F '\\(ms\\)' '{print $1}' | awk -F ':' '{if($(NF) > 10) print $0}'

netstat -ntp | grep 8088
netstat -tnlp

ps -ef|grep ans|grep -v grep|cut -c 9-15|xargs kill -9

for i in `get_instance_by_cloudapp spcenter.pay -i |awk '{print $2}'`; do echo $i && ssh work@$i "cd /home/work/spcenter/ && ls";
 done

grep 'FATAL.*not exist.*/sftpdata-zsy/wallet-sp-sftp/' daily_payment_trans_ct_worker.log.wf  | grep -aoP '\d+\/data'|sort|uniq -c | wc -l

# 查看索引
GET /_cat/indices?v
# 查看各节点磁盘空间
GET /_cat/allocation?v&s=disk.percent

GET /sp_customer_out_info/_mappings
GET /sp_data_modify_log/_settings

GET /sp_data_modify_log/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "match_phrase": {
            "field_name": "f_diff_flag"
          }
        },
        {
          "match_phrase": {
            "table": "t_sp_funding_agency_card"
          }
        }
      ]
    }
  },
  "from": 0,
  "size": 10,
  "track_total_hits": true
}
POST /sp_data_modify_log/_delete_by_query
{
  "query": {
    "bool": {
      "must": [
        {
          "match_phrase": {
            "field_name": "f_diff_flag"
          }
        },
        {
          "match_phrase": {
            "table": "t_sp_funding_agency_card"
          }
        }
      ]
    }
  }
}
GET /sp_trans_4/_search
{
    "query": {
        "bool": {
            "must": [
                {
                    "range": {
                        "buyer_user_id": {
                            "gt": "10000000000000"
                        }
                    }
                },
                {
                    "range": {
                        "create_time": {
                            "from": "2024-01-01 00:00:00",
                            "to": "2024-04-12 23:00:00"
                        }
                    }
                }
            ]
        }
    },
    "from": 0,
    "size": 10,
    "track_total_hits": true
}

mysql -hxxx -Pxxx -uxxx -pxxx --database db_vip_bfb -e "select a.f_customer_id, a.f_customer_name from t_sp_customer a left join t_sp_customer_info b on a.f_customer_id=b.f_customer_id where a.f_customer_state in (3,136) and a.f_account_type=2 and (b.f_register_capital_currency='' or b.f_register_capital='') and a.f_test_customer=1 and a.f_certificate_type=1 and b.f_business_type in (1,2);" > test.txt