X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=VNFs%2FDPPD-PROX%2Fhelper-scripts%2Frapid%2Fsharkproxlog.sh;h=c2c4ab07f5068281fd59ab3749b047dbcac1c0cd;hb=refs%2Fchanges%2F22%2F71722%2F1;hp=3c1a90ee49026167c7c24e3e8e3917ca750b79a5;hpb=d55e457cfc09e84c0a3fb8c32a21517c4388a131;p=samplevnf.git diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/sharkproxlog.sh b/VNFs/DPPD-PROX/helper-scripts/rapid/sharkproxlog.sh index 3c1a90ee..c2c4ab07 100755 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/sharkproxlog.sh +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/sharkproxlog.sh @@ -1,5 +1,5 @@ ## -## Copyright (c) 2010-2019 Intel Corporation +## Copyright (c) 2010-2020 Intel Corporation ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the License. @@ -16,4 +16,16 @@ ## This code will help in using tshark to decode packets that were dumped ## in the prox.log file as a result of dump, dump_tx or dump_rx commands -egrep '^[0-9]{4}|^[0-9]+\.' prox.log | text2pcap -q - - | tshark -r - +#egrep '^[0-9]{4}|^[0-9]+\.' prox.log | text2pcap -q - - | tshark -r - +while read -r line ; do + if [[ $line =~ (^[0-9]{4}\s.*) ]] ; + then + echo "$line" >> tempshark.log + fi + if [[ $line =~ (^[0-9]+\.[0-9]+)(.*) ]] ; + then + date -d@"${BASH_REMATCH[1]}" -u +%H:%M:%S.%N >> tempshark.log + fi +done < <(cat prox.log) +text2pcap -t "%H:%M:%S." -q tempshark.log - | tshark -r - +rm tempshark.log