0
我有一个脚本来从jmx.out文件中提取各种参数的度量。有没有办法在单一命令中执行逻辑以避免每次读取jmx.out文件? ?grep从单个文件的多个模式和存储在每个模式的单独文件的输出
curl -s "server.hostname.com:12345/jmx" > jmx.out
cat jmx.out | grep -E "CallQueueLength" >> call_queue_length.out
cat jmx.out | grep -E "RpcProcessingTimeAvgTime" >> rpc_avg_time.out
cat jmx.out | grep -E "DeleteNumOps" >> DeleteNumOps.out
cat jmx.out | grep -E "CreateFileOps" >> CreateFileOps.out
cat jmx.out | grep -E "GetFileInfoNumOps" >> GetFileInfoNumOps.out
文件名可以更改吗?你有超过5个参数阅读? –