我从 NetApp 查询中得到了这个结果
Object: nfsv4_diag
Instance: nfs4_diag
Start-time: 6/4/2020 16:55:40
End-time: 6/4/2020 16:55:40
Scope: NODE1
Counter Value
-------------------------------- --------------------------------
storePool_ByteLockAlloc 0
storePool_ClientAlloc 60
storePool_CopyStateAlloc 0
storePool_DelegAlloc 0
storePool_DelegStateAlloc 0
storePool_LayoutAlloc 0
storePool_LayoutStateAlloc 0
storePool_LockStateAlloc 0
storePool_OpenAlloc 86
storePool_OpenStateAlloc 86
storePool_OwnerAlloc 10
storePool_StringAlloc 70
Object: nfsv4_diag
Instance: nfs4_diag
Start-time: 6/4/2020 16:55:40
End-time: 6/4/2020 16:55:40
Scope: NODE2
Counter Value
-------------------------------- --------------------------------
storePool_ByteLockAlloc 1246
storePool_ClientAlloc 29
storePool_CopyStateAlloc 0
storePool_DelegAlloc 0
storePool_DelegStateAlloc 0
storePool_LayoutAlloc 0
storePool_LayoutStateAlloc 0
storePool_LockStateAlloc 468
storePool_OpenAlloc 811
storePool_OpenStateAlloc 811
storePool_OwnerAlloc 519
storePool_StringAlloc 548
Object: nfsv4_diag
Instance: nfs4_diag
Start-time: 6/4/2020 16:55:40
End-time: 6/4/2020 16:55:40
Scope: NODE3
Counter Value
-------------------------------- --------------------------------
storePool_ByteLockAlloc 165
storePool_ClientAlloc 27
storePool_CopyStateAlloc 0
storePool_DelegAlloc 0
storePool_DelegStateAlloc 0
storePool_LayoutAlloc 0
storePool_LayoutStateAlloc 0
storePool_LockStateAlloc 135
storePool_OpenAlloc 272
storePool_OpenStateAlloc 272
storePool_OwnerAlloc 152
storePool_StringAlloc 179
我想将其转换为:
NODE1.storePool_ByteLockAlloc=0;NODE1.storePool_ClientAlloc=60;NODE1.storePool_CopyStateAlloc=0;............NODEn.storePool_ByteLockAlloc=165;
对于我从输出中获得的所有节点(不仅是 3 个)。
我试过用这个替换输出:
output.replace(' ', '').replace('Alloc', 'Alloc=').replace('\r','').replace('\n',' ')
但这并没有给我我需要的结果。
一些想法?
非常感谢您的帮助。