Log Analytics 2019 - Coralogix partners with IDC Research to uncover the latest requirements by leading companies



Cloudwatch Logs

Cloudwatch logs & metrics coralogix

Coralogix provides a predefined Lambda function to forward your Cloudwatch logs straight to Coralogix.



1. Create an “author from scratch” Node.js 10.x runtime lambda with basic permissions:
coralogix cloudwatch integration author

2. At “Code entry type” choose “Edit code inline” and paste the function code.

3. Add the mandatory environment variables private_keyapp_namesub_name:

Private Key – A unique ID that represents your company, this Id will be sent to your mail once you register to Coralogix.

Application Name – Used to separate your environment, e.g. SuperApp-test/SuperApp-prod.

SubSystem Name – Your application probably has multiple subsystems, for example, Backend servers, Middleware, Frontend servers, etc. 

cloudwatch definitions

Note – If you have multiline messages you may need to pass newline_pattern environment variable with a regular expression to split your log records.

coralogix cloudwatch integration multiline

4. Go to "Add triggers" and add "CloudWatch logs":

cw logs to Coralogix

5.Configure the trigger, select the desired “Log group” and give it a name:
cloudwatch logs Coralogix
6. Increase Memory to 1024MB and Timeout to 30 sec:
Lambda config cw logs
7. Click "Save".
Here is presented the Terraform module to deploy Lambda Function.

Add this module to your manifest and change its options:

provider "aws" {
  region = "eu-west-1"

module "cw_to_coralogix" {
  source =  "git::https://github.com/coralogix/integrations-docs.git//integrations/aws/cloudwatch/terraform"

  private_key = "YOUR_PRIVATE_KEY"
  app_name    = "APP_NAME"
  log_group   = "YOUR_LOG_GROUP_NAME"

Download the module and apply these changes:

$ terraform init
$ terraform apply


Here is presented the CloudFormation template to deploy Lambda Function.

coralogix cloudwatch integration cloudformation option

To set up the function, execute this:

$ curl -sSL -o cwToCoralogix.yaml https://raw.githubusercontent.com/coralogix/integrations-docs/module/integrations/aws/cloudwatcg/cloudformation/template.yaml
$ aws cloudformation deploy \
    --region eu-west-1 \
    --template-file ./cwToCoralogix.yaml \
    --stack-name CWToCoralogix \
    --capabilities CAPABILITY_NAMED_IAM \
    --parameter-overrides \
        PrivateKey=YOUR_PRIVATE_KEY \
        ApplicationName=APP_NAME \

Start solving your production issues faster

Let's talk about how Coralogix can help you better understand your logs

No credit card required

Get a personalized demo

Jump on a call with one of our experts and get a live personalized demonstration