Fix for container .env file and small updates
[samplevnf.git] / VNFs / DPPD-PROX / helper-scripts / rapid / sharkproxlog.sh
1 ##
2 ## Copyright (c) 2010-2020 Intel Corporation
3 ##
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
7 ##
8 ##     http://www.apache.org/licenses/LICENSE-2.0
9 ##
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.
15 ##
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
18
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.*) ]] ;
22     then
23         echo "$line" >> tempshark.log
24     fi
25     if [[ $line =~ (^[0-9]+\.[0-9]+)(.*) ]] ;
26     then
27         date -d@"${BASH_REMATCH[1]}" -u +%H:%M:%S.%N >> tempshark.log
28     fi
29 done < <(cat prox.log)
30 text2pcap -t "%H:%M:%S." -q tempshark.log - | tshark -r -
31 rm tempshark.log