CloudWatch Integration
Overview
CloudWatch Integration enables you to transfer logs from AWS CloudWatch to SnappyFlow. An AWS Lambda handler is specifically designed using AWS Lambda functions to integrate AWS CloudWatch and SnappyFlow.
How to Integrate?
Prerequisite
Click the below URL to download the zip file that contains the latest build of the lambda handler.
Step 1: Create a lambda function
Login into your AWS account.
Go to the AWS Lambda service and click the
Create function
button.In the Create function window, choose the
Author from scratch
option.In the Basic information window, enter the following details:
- Function Name: Give a meaningful function name
- Runtime: Select Go 1.x
- Architecture: Select based on your requirement
Click the
Create function
button.
Step 2: Add Trigger
Click the
Add trigger
button.In the Add trigger window, select the following details:
- Source: Select the source as CloudWatch Logs
- Log group: Select a log group
- Filter name: give a filter name based on the requirement
- Filter pattern (optional)
Click the
Add
button.
Step 3: Enable the Lambda handler
Go to the Code > Code Source tab.
Click the
Upload from
button and choose the.zip file
option.Upload the
Lambda-handler.zip
file and save.Go to Runtime settings, click the
Edit
button, and change the default handler tosfagent
.
Step 4: Add Environment variables
Go to the Configuration section.
Navigate to the Environment variable tab and click on the
Edit
button.In the Edit environment variables window, click the
Add Environment variable
button.Add the below-mentioned environment variables.
- Key:
APP_NAME
, Value: Name of the application - Key:
KEY
, Value: Profile key copied from SnappyFlow - Key:
NAME
, Value: Name of the Instance - Key:
PROJECT_NAME
, Value: Name of the project
- Key:
- Click on the
Save
button.
View Logs
Login into SnappyFlow.
Navigate to the Application tab > Project > Application and click the Dashboard icon.
In the Dashboard window, navigate to Log Management > Primary Storage.
In the Primary Storage window, you can see the logs transferred from CloudWatch.
To see the raw data, navigate to the Browse Data tab and enter the below details:
Index: Log
Instance: Select an instance
Plugin: cloudwatch-logs
Document Type: cloudwatchLogs