You need to send log data to MSK so it can subsequently be sent to OpenSearch (in real time) by the Lambda function we deployed.
You will send the log data to Kafka via. a Python Script run from Cloud9



Kafka_OpenSearch_Anomaly_Detection/Kafka/2_base_data.pypip install pykafkacd ~ in the Cloud9 terminalpython environment/Kafka_OpenSearch_Anomaly_Detection/Kafka/2_base_data.py
Allow the python script to run until the terminal looks similar to the image below

Kafka_OpenSearch_Anomaly_Detection/Kafka/3_anomoly_data.pypython environment/Kafka_OpenSearch_Anomaly_Detection/Kafka/3_anomoly_data.py
Allow this python script to run until completion. This may take several minutes. If you leave the Cloud9 environment open in your web browser as a separate tab you can move on to the next steps
When the script is complete the Cloud9 terminal will look similar to the image below

We have completed the process of sending data to MSK. When you are ready begin the next step Anomaly Detection