All Apps and Add-ons

How can I index AWS Cloudwatch logs from HEC? Error when creating lambda

Explorer

I have followed this blog https://www.splunk.com/blog/2017/02/03/how-to-easily-stream-aws-cloudwatch-logs-to-splunk.html
streaming cloudwatch logs to splunk via lambda and HEC

when i create my lambda and test i get this error

"errorMessage": "Cannot find module './../../../../../splunk-cloudwatch-logs-processor/lib/mysplunklogger'",
"errorType": "Error",
"stackTrace": [
"Function.Module._load (module.js:417:25)",
"Module.require (module.js:497:17)",
"require (internal/module.js:20:19)",

0 Karma

Splunk Employee
Splunk Employee

If you edit the lambda function code as follows:

Find
const SplunkLogger = require('./../../../../../splunk-cloudwatch-logs-processor/lib/mysplunklogger');

and replace with

const SplunkLogger = require('./lib/mysplunklogger');

I just tried on a test instance and that worked.

0 Karma