2 ## Copyright (c) 2010-2020 Intel Corporation
4 ## Licensed under the Apache License, Version 2.0 (the "License");
5 ## you may not use this file except in compliance with the License.
6 ## You may obtain a copy of the License at
8 ## http://www.apache.org/licenses/LICENSE-2.0
10 ## Unless required by applicable law or agreed to in writing, software
11 ## distributed under the License is distributed on an "AS IS" BASIS,
12 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ## See the License for the specific language governing permissions and
14 ## limitations under the License.
16 ## This code will help in using tshark to decode packets that were dumped
17 ## in the prox.log file as a result of dump, dump_tx or dump_rx commands
19 #egrep '^[0-9]{4}|^[0-9]+\.' prox.log | text2pcap -q - - | tshark -r -
20 while read -r line ; do
21 if [[ $line =~ (^[0-9]{4}\s.*) ]] ;
23 echo "$line" >> tempshark.log
25 if [[ $line =~ (^[0-9]+\.[0-9]+)(.*) ]] ;
27 date -d@"${BASH_REMATCH[1]}" -u +%H:%M:%S.%N >> tempshark.log
29 done < <(cat prox.log)
30 text2pcap -t "%H:%M:%S." -q tempshark.log - | tshark -r -