Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 26d92d3

Browse files
committedDec 26, 2024·
The scripts to extract flow tables from agent
1 parent 0c97b63 commit 26d92d3

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
 

‎extract_flow_a_table.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
flow_table_dump_part=log.AllFlowsreg
2+
n_flow_key=any #any value is needed to start the extraction procedure
3+
stop_flow_key="0-0-0-0-0-0.0.0.0-0.0.0.0"
4+
i_part=0
5+
curl http://127.0.0.1:8085/Snh_FetchAllFlowRecords? > $flow_table_dump_part-$i_part
6+
n_flow_key=`xmllint --xpath "string(//FlowRecordsResp/flow_key)" $flow_table_dump_part-$i_part`
7+
while [ "$n_flow_key" != "" ] && [ "$n_flow_key" != "$stop_flow_key" ]
8+
do
9+
i_part=`expr $i_part + 1`
10+
curl http://127.0.0.1:8085/Snh_NextFlowRecordsSet?flow_key=$n_flow_key > $flow_table_dump_part-$i_part
11+
n_flow_key=`xmllint --xpath "string(//FlowRecordsResp/flow_key)" $flow_table_dump_part-$i_part`
12+
done
13+
echo $n_flow_key

‎extract_flow_k_table.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
flow_table_dump_part=log.AllKFlowsreg
2+
n_records=1 #any value is needed to start the extraction procedure
3+
i_part=0
4+
curl http://127.0.0.1:8085/Snh_KFlowReq? > $flow_table_dump_part-$i_part
5+
n_records=`xmllint --xpath "string(//KFlowResp/flow_handle)" $flow_table_dump_part-$i_part`
6+
while [ "$n_records" != "" ] && [ "$n_records" -gt 0 ]
7+
do
8+
i_part=`expr $i_part + 1`
9+
curl http://127.0.0.1:8085/Snh_NextKFlowReq?flow_handle=$n_records > $flow_table_dump_part-$i_part
10+
n_records=`xmllint --xpath "string(//KFlowResp/flow_handle)" $flow_table_dump_part-$i_part`
11+
done

0 commit comments

Comments
 (0)
Please sign in to comment.