Hello All,
Anyone have a script that can parse below the DATAXLATE and grab routes paired with the TRXID? I’m having an issue trying to parse that out, I’m pretty new to TCL. I’ve tried splitting by \n or \r or “{” and not able to grasp the data.
#grab threads
set siteconns [lsort [netcfgGetConnList]]
set output [open “~/temp/client_serv_list/$site.txt” “w”]
set sep “{”
foreach thread $siteconns {
set data [netcfgGetConnData $thread]
#set protocol {}; keylget data PROTOCOL.TYPE protocol
#set xlate {}; keylget data DATAXLATE xlate
set client {}; keylget data PROTOCOL.ISSERVER client
set multiSER {}; keylget data PROTOCOL.ISMULTI multiSER
set dataxlate {}; keylget data DATAXLATE dataxlate
set sections [split $dataxlate $sep]
set trxid [regexp {TRXID:\s*(\S+)} $sections ]
if {$client == 0 && $multiSER == 0} {
puts $output “Clients:$thread:$client”
}
if {$client == 1 || $multiSER == 1} {
puts $output “Servers:$thread:$client:$multiSER:$trxid”
}
}
#close file
close $output
Thank you,
joekavanagh889@hotmail.com