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個參數閱讀? –