Splunk AppDynamics

Pushing data to Events schema

Vishnu_Kumar_D_
Explorer

Hi All,

Am trying to build a custom Extension with Java.

As per this page, https://docs.appdynamics.com/display/PRO43/Build+a+Monitoring+Extension+Using+Java

We can use AManagedMonitor class to push data to Metrics schema

So is there a class that we can use to push data to Events Schema.

Am aware of the 'curl' method to push Events via RestAPI to Event Service.

But am looking for a native java approach for this.

Does anyone know of a method to use for this scenario?

Thanks,

Vishnu

Labels (1)
Tags (3)
0 Karma

Amit_Jha
Path Finder

The only way to access the events service data store is using the analytics api. If you do not want to use curl you can convert your request to a java code and use it. But at the end it will be using the events api itself. For example something like below as a sample:

OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/vnd.appd.events+text;v=2");
RequestBody body = RequestBody.create(mediaType, "<ADQL query goes here>");
Request request = new Request.Builder()
.url("https://analytics.api.appdynamics.com/events/query?mode=page&size=1000&offset=100")
.post(body)
.addHeader("content-type", "application/vnd.appd.events+text;v=2")
.addHeader("x-events-api-accountname", "Global Account Name")
.addHeader("x-events-api-key", "api key")
.addHeader("cache-control", "no-cache")
.addHeader("postman-token", "98fdc32c-bd67-fec7-6f5d-d87b619771c5")
.build();
Response response = client.newCall(request).execute();

CommunityUser
Splunk Employee
Splunk Employee

Hi @Vishnu Kumar.D R

Were you able to access the events service data store using the tip suggested by @Amit.Jha?

Let us know how it went.

If you think @Amit.Jha answer is the right solution to your question, please mark it as the accepted solution, so others can find their answers quickly.

0 Karma
Get Updates on the Splunk Community!

Fueling your curiosity with new Splunk ILT and eLearning courses

At Splunk Education, we’re driven by curiosity—both ours and yours! That’s why we’re committed to delivering ...

Splunk AI Assistant for SPL 1.1.0 | Now Personalized to Your Environment for Greater ...

Splunk AI Assistant for SPL has transformed how users interact with Splunk, making it easier than ever to ...

Unleash Unified Security and Observability with Splunk Cloud Platform

     Now Available on Microsoft AzureOn Demand Now Step boldly into the AI revolution with enhanced security ...