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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...