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 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...