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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...