I have reviewed a number of similar questions on stackoverflow, but been unable to locate an answer which applies to my data/string.
I have a string which is effectively a list of dictionaries. In the fields, numbers are not surrounded by double quotes. If I try to use ast to evaluate the string, part of the string is cut off and I am unsure why. Could someone help me determine an appropriate way to read in this string and create a list of dicts.
Thanks,
>>> print(ascii_data)
[{"measurement": "cpu_load_short","tags": {"host": "server999","region": "us-west-1"},"fields": {"value": 0.99}},{"measurement": "cpu_load_short","tags": {"host": "server888","region": "us-east-1"},"fields": {"value": 0.88}}]
>>> x = ast.literal_eval(ascii_data)
>>> print(x)
[{'fields': {'value': 0.99}, 'tags': {'host': 'server999', 'region': 'us-west-1'}, 'measurement': 'cpu_load_short'}, {'fields': {'value': 0.88}, 'tags': {'host': 'server888', 'region': 'us-east-1'}, 'measurement': 'cpu_load_short'}]