Skip to content

Log data -> Kafka (MSK) - Lambda -> OpenSearch - Anomaly Detection

Notifications You must be signed in to change notification settings

ev2900/OpenSearch_Kafka_Anomaly_Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kafka OpenSearch Anomaly Detection Demo

map-user map-user map-user

Architecture

OpenSearch_demo_Architecture

Instructions

  1. Launch CloudFormation stack

    Launch CloudFormation Stack

  2. Update msk security group to allow inbound traffic from Cloud9 security group

    • Navigate to Security Group page in the AWS console
    • Select msk security group
    • Add inbound bound rule allowing all traffic from the aws-cloud9 security group
  3. Create Kafka topic

  4. Create OpenSearch index

  5. Configure Lambda

    • Navigate to lambda function page in the AWS console

    • Create a lambda function

      • Funcation name = msk-os-lambda
      • Runtime = python 3.7
      • Architecture = x86_64
      • Permissions, Execution role = Use an existing role Lambda-MSK-OpenSearch-Role
    • Add MSK trigger

      • MSK cluster = msk-cluster-workshop
      • Batch size = 500
      • Batch window = 30
      • Topic name = ApplicationMetricTopic
      • Starting position = Latest
    • Add code

      • Copy and past the code from Lambda/1_lambda_function_code_batch.py into the code section of the lambda function
      • Update the os_url variable in the lambda code with the domain endpoint of the OpenSearch cluster deployed by the CloudFormation stack
      • Deploy the lambda function
  6. Send data to OpenSearch

  7. Create + run OpenSearch anomaly detector

  8. Login to the OpenSeach dashboard, navigate to the anomoly detection section. Explore the anomolies OpenSearch detected

Future Improvements Planned for this Repository

  • Automate more of the set up ie. try to minimize the number of steps in the instructions

Releases

No releases published

Packages

No packages published

Languages