I have a piece of code which generates a output as chunk.
TIBCO ActiveMatrix BusinessWorks version 6.4.2, hotfix 7, build V103, 2018-07-18 Connecting to the BW Agent using TIBCO ActiveSpaces (Java). Enterprise Edition. Version 2.1.6.011 Connected to BW Agent
Domain: 3APIServices
Name Version AppSpace Profile Status Deployment Status (Running/Total)
AS_CRM_032-CustomerAccount_CRM.application 1.0 AS_CRM_032_AppSpace PROFILE.substvar Running Deployed (1/1)
a
/home/REBUSCLOUD/kramk/ServiceLive.sh: line 6: /opt1/tibco/tea/2.3/bin/bwadmin: No such file or directory
TIBCO ActiveMatrix BusinessWorks version 6.4.2, hotfix 7, build V103, 2018-07-18
Connecting to the BW Agent using
TIBCO ActiveSpaces (Java). Enterprise Edition. Version 2.1.6.011
Connected to BW Agent
Domain: 3APIServices
Name Version AppSpace Profile Status Deployment Status (Running/Total)
AS_DW_021_3APIFailureEvents_DW.application 1.0 AS_DW_021_AppSpace PROFILE.substvar Running Deployed (1/1)
a
/home/REBUSCLOUD/kramk/ServiceLive.sh: line 6: /opt1/tibco/tea/2.3/bin/bwadmin: No such file or directory
TIBCO ActiveMatrix BusinessWorks version 6.4.2, hotfix 7, build V103, 2018-07-18
Connecting to the BW Agent using
TIBCO ActiveSpaces (Java). Enterprise Edition. Version 2.1.6.011
Connected to BW Agent
I need the output to be converted to json format like below
{
"Domain": "3APIservices",
"Name": "AS_CRM_032-CustomerAccount_CRM.application",
"Version": "1.0",
"Appspace": "AS_CRM_032_AppSpace",
},
Can some one help me on this?
Below is the piece of code I used. As this is in loop i will get outputs one by one. The thing is I need that to be in json, so that I can use it somewhere else.
for f in ls -d /opt1/tibco/bw/6.4/domains/*/appspaces/*; do
DomainName="${f%%'/appspaces/'*}"
DomainName="${DomainName##*/}"
AppSpaceName="${f##*'/'}"
Command_To_Execute="/opt1/tibco/bw/6.4/bin/bwadmin --propFile /opt1/tibco/bw/6.4/bin/bwadmin.tra show -domain ${DomainName} -appspace ${AppSpaceName} applications"
/opt1/tibco/tea/2.3/bin/bwadmin show -domain domains -appspace appspaces applications
if [ "$DomainName" != 'ls' -a "$DomainName" != "-d" ]
then
eval "${Command_To_Execute}"
echo "a"
else
""
fi
done
*matches in the/opt1/tibco/bw/6.4/domains/*/appspaces/*pattern, as these seem to hold some of the data that you want as output.