All Apps and Add-ons

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

bobmccoy
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

pauld_splunk
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
Get Updates on the Splunk Community!

Fall Into Learning with New Splunk Education Courses

Every month, Splunk Education releases new courses to help you branch out, strengthen your data science roots, ...

Super Optimize your Splunk Stats Searches: Unlocking the Power of tstats, TERM, and ...

By Martin Hettervik, Senior Consultant and Team Leader at Accelerate at Iver, Splunk MVPThe stats command is ...

How Splunk Observability Cloud Prevented a Major Payment Crisis in Minutes

Your bank's payment processing system is humming along during a busy afternoon, handling millions in hourly ...