ClassNotFoundException when forwarding events from S3 to Elastic Cloud

Hi,

I’ve been pulling my hair over this issue however unable to solve it

I am following the Cloudflare’s official documentation, linked [here(https://developers.cloudflare.com/fundamentals/data-products/analytics-integrations/elastic/)]

I have added the function to lambda and provided the relevant role. However, while testing the code, I am getting the following error:

{ "errorMessage": "Class not found: com.cloudflare.elastic.ElasticLambdaForwarder", "errorType": "java.lang.ClassNotFoundException" }

I dont know if this is something that is frequent or not

The runtime im using is Java 8 on Amazon Linux 2. I have tried it with AL1 and Java 11 Corretto as well but the same error as there

I am using the following as my handler: com.cloudflare.elastic.ElasticLambdaForwarder::handleRequest

Further, the release Im working with is as follows:

I have been searching for quite a few days and unable to find any solution as of yet :frowning:

Hi,

I’ve been pulling my hair over this issue however unable to solve it

I am following the Cloudflare’s official documentation, linked [here]

I have added the function to lambda and provided the relevant role. However, while testing the code, I am getting the following error:

{ "errorMessage": "Class not found: com.cloudflare.elastic.ElasticLambdaForwarder", "errorType": "java.lang.ClassNotFoundException" }

I dont know if this is something that is frequent or not

The runtime im using is Java 8 on Amazon Linux 2. I have tried it with AL1 and Java 11 Corretto as well but the same error as there

I am using the following as my handler: com.cloudflare.elastic.ElasticLambdaForwarder::handleRequest

Further, the release Im working with is as follows:

I have been searching for quite a few days and unable to find any solution as of yet :frowning:

Hi,

So for anyone running into this issue in the future.

What actually was happening that the link in the documentation for code for the Lambda function is actually redirecting to the code that first needs to be built through the following command:

./gradlew clean build

You can either build it yourself ( you would need JRE and JDK both ) or use the one of the previous releases for fetching the already built lambda function code here

Further, if you run into this issue later down the line, please ensure the following to start receiving logs into the proper ElasticSearch Index:

  1. Create an index by the name of cloudflare-test through the following request

curl -X PUT "localhost:9200/cloudflare-test?pretty"

  1. Download the index templates from the same release i.e.

  2. Issue the following command through terminal from your own computer:

./[install-artifacts.sh](http://install-artifacts.sh) -u elastic -p <RANDOM PASSWORD> -e https://_<YOUR DEPLOYMENT ENDPOINT>_:9243

After this, you should hopefully see the following output:

Installing ingest pipeline to https://_<YOUR DEPLOYMENT ENDPOINT>_ for daily indices {"acknowledged":true} Installing ingest pipeline to https://_<YOUR DEPLOYMENT ENDPOINT>_ for weekly indices {"acknowledged":true} Installing index template to https://_<YOUR DEPLOYMENT ENDPOINT>_ {"acknowledged":true}

After which the logs should start appearing on Kibana !

Thanks all and have a great rest of your day !! :smile:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.