Splunk Enterprise

Using Splunk SDK for Javascript in Angular 2+ application

kennyyang
Engager

I need some help on how to use Splunk SDK for Javascript to render charts directly from search result(JSON) without using Splunk SearchManager in Angular 2+ application.
I am exploring the possibility to just use the UI Chart/Timeline modules directly to render the results (JSON format) with the SplunkJS package. I have tried couple of ways to import JS files in the Angular 2+ project, but could not invoke the UI functions.
Here is the sample component I created and hopeful I can import splunk SDK JS into this component, but unsuccessful.
import * as splunkjs from '../../../assests/client/splunk.js';
import * as splunkui from '../../../assests/client/splunk.ui.js';
import * as timeline from '../../../assests/client/splunk.ui.timeline.js';

...

then inside component I have a function defined as
drawline() {
const service: any = new splunkjs.Service();
}

Can someone give me some guidance about how to call splunkjs lib methods here?

Thanks

Tags (1)

FNFI_Aniruddha
Observer

I have an angular 16 application also facing same issue.

0 Karma

badrinath_itrs
Communicator

This question was asked 2 years back, I am also having same problem and just wanted to check if anyone has any luck in importing the sdk in Angular.

I found its very hard as there is hardly any documentation available .

@kennyyang , Did you manage to get this working ? 

0 Karma
Get Updates on the Splunk Community!

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 at Splunk .conf24 ...

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

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...