なぜAWKを使用しないのですか?あなたのラインで$ 3 =第三位(時間)
サンプルデータ(test.txtの)
# Query_time: 9.353543 Lock_time: 0.000036 Rows_sent: 0 Rows_examined: 9091792 use Aarti_Engineering_Purchase; SET timestamp=1482477646; SELECT fieldvalue,I.InquiryID FROM FormMaster FM,FormDetail FD,Inquiry I,InquiryDetails I.InquiryID = ID.InquiryID AND AttributeValue IN ('ProjectCode');
# Query_time: 7.353543 Lock_time: 0.000036 Rows_sent: 0 Rows_examined: 9091792 use Aarti_Engineering_Purchase; SET timestamp=1482477646; SELECT fieldvalue,I.InquiryID FROM FormMaster FM,FormDetail FD,Inquiry I,InquiryDetails I.InquiryID = ID.InquiryID AND AttributeValue IN ('ProjectCode');
# Query_time: 9.353543 Lock_time: 0.000036 Rows_sent: 0 Rows_examined: 9091792 use Aarti_Engineering_Purchase; SET timestamp=1482477646; SELECT fieldvalue,I.InquiryID FROM FormMaster FM,FormDetail FD,Inquiry I,InquiryDetails I.InquiryID = ID.InquiryID AND AttributeValue IN ('ProjectCode');
# Query_time: 2.353543 Lock_time: 0.000036 Rows_sent: 0 Rows_examined: 9091792 use Aarti_Engineering_Purchase; SET timestamp=1482477646; SELECT fieldvalue,I.InquiryID FROM FormMaster FM,FormDetail FD,Inquiry I,InquiryDetails I.InquiryID = ID.InquiryID AND AttributeValue IN ('ProjectCode');
# Query_time: 28.353543 Lock_time: 0.000036 Rows_sent: 0 Rows_examined: 9091792 use Aarti_Engineering_Purchase; SET timestamp=1482477646; SELECT fieldvalue,I.InquiryID FROM FormMaster FM,FormDetail FD,Inquiry I,InquiryDetails I.InquiryID = ID.InquiryID AND AttributeValue IN ('ProjectCode');
と単に:
awk '$3 < 7' ./test.txt
またはあなたが好きな時間に7を交換...とファイルに保存
awk '$3 > 7.5' ./test.txt >> ./long_query.txt
もありのようなクエリ他のパラメータ...#時間は:161223 12時50分46秒 #ユーザ@ホスト:ルート[ルート] @ [10.160.15.69]このawkは正常に動作しません。 –