
How should we convert to json if i get different patterns of csv log messages.


but my requirement is i need to convert csv (any pattern) to json.įor the above csv logs i converted like below json. Call the ‘writer’ function passing the CSV file as a parameter and use the ‘writerow’ method to write the JSON file content (now converted into Python dictionary) into the CSV file. So far i created script to convert one type of csv pattern(above showed) to json. You have to convert the JSON data into a Python dictionary using the ‘load’ method. I have a scenario, I am receiving logs in csv format to kinesis firehose directly and with help of lambda function (python) I need to transform the csv logs format to json format and return the output back to kinesis.
