Mar-15-2018, 04:56 PM
Dear experts
I have python script which gives output like..The below is string
b"{'text': 'Cluster1 is healthy\nNode 123.4.0.3:8091 is Up\nNode 123.4.0.2:8091 is Up\nNode 123.4.0.4:8091 is Up'}\n{'text': 'Cluster2 is unhealthy\nNode 123.8.0.3:8091 is Down\nNode 123.8.0.2:8091 is Up\nNode 123.8.0.4:8091 is Up'}\n"
What I tried so far:
{'text': 'Cluster1 is healthy
Node 123.4.0.3:8091 is Up
Node 123.4.0.2:8091 is Up
Node 123.4.0.4:8091 is Up'}
{'text': 'Cluster2 is unhealthy
Node 123.8.0.3:8091 is Up
Node 123.8.0.2:8091 is Down
Node 123.8.0.4:8091 is Up'}
I need to format above like something below
Cluster1 is healthy
Node 123.4.0.3:8091 is Up
Node 123.4.0.2:8091 is Up
Node 123.4.0.4:8091 is Up
Cluster2 is unhealthy
Node 123.8.0.3:8091 is Up
Node 123.8.0.2:8091 is Down
Node 123.8.0.4:8091 is Up
Please help what additional things I need to do
I have python script which gives output like..The below is string
b"{'text': 'Cluster1 is healthy\nNode 123.4.0.3:8091 is Up\nNode 123.4.0.2:8091 is Up\nNode 123.4.0.4:8091 is Up'}\n{'text': 'Cluster2 is unhealthy\nNode 123.8.0.3:8091 is Down\nNode 123.8.0.2:8091 is Up\nNode 123.8.0.4:8091 is Up'}\n"
What I tried so far:
message = b"{'text': 'Cluster1 is healthy\nNode 123.4.0.3:8091 is Up\nNode 123.4.0.2:8091 is Up\nNode 123.4.0.4:8091 is Up'}\n{'text': 'Cluster2 is unhealthy\nNode 123.8.0.3:8091 is Down\nNode 123.8.0.2:8091 is Up\nNode 123.8.0.4:8091 is Up'}\n" message1 = message.rstrip('\n') print(message1)But I am getting like below
{'text': 'Cluster1 is healthy
Node 123.4.0.3:8091 is Up
Node 123.4.0.2:8091 is Up
Node 123.4.0.4:8091 is Up'}
{'text': 'Cluster2 is unhealthy
Node 123.8.0.3:8091 is Up
Node 123.8.0.2:8091 is Down
Node 123.8.0.4:8091 is Up'}
I need to format above like something below
Cluster1 is healthy
Node 123.4.0.3:8091 is Up
Node 123.4.0.2:8091 is Up
Node 123.4.0.4:8091 is Up
Cluster2 is unhealthy
Node 123.8.0.3:8091 is Up
Node 123.8.0.2:8091 is Down
Node 123.8.0.4:8091 is Up
Please help what additional things I need to do