Splunk Dev

Javascript SDK client-side "examples" [Hello Word ] issue

Lossino
New Member

I'am facing an issue while I tried to run "Helloword" example from SDK package. I'am working on win 7 with splunk 5.0.1 (installed in local). I set up this following config with my own :
username = "admin";
password = "changeme";
scheme = "https";
host = "localhost";
port = "8089";
version = "5.0.1";
But I run the example from browser it doesn't work and this error in my console: TypeError: req is undefined
if (req.wasAborted) {

Any help please !!

thanks in advance.

Tags (2)
0 Karma
1 Solution

Rocket66
Communicator

This is a bug in the splunk.js!

Fix the error on the SDKPath/client/splunk.js @ Line-number 6002 😆 "if (res.wasAborted)" instead of "if (reg.wasAborted)"

or use the "splunk.min.js" instead.

hope that helps,

Robert

View solution in original post

Rocket66
Communicator

This is a bug in the splunk.js!

Fix the error on the SDKPath/client/splunk.js @ Line-number 6002 😆 "if (res.wasAborted)" instead of "if (reg.wasAborted)"

or use the "splunk.min.js" instead.

hope that helps,

Robert

Lossino
New Member

Ok thanks again. In fact, I'am now at server-side. my web application run on tomcat server. I'm able to connect to my splunk server from my web application, run searches and get results. So I need to draw some graphs from data results using timeline.js and charting.js. Whenever it seems that node.js is required(refer to the error occurred). Do I have to refer to node.js in my web application? or to install it?

0 Karma

Rocket66
Communicator

"require()" is a NodeJS (server-side) command - so if you run a (Node)JS on client-side you will get an error.

0 Karma

Lossino
New Member

Thanks a lot your answer help to run the example at cleint-side. But i'am ficing another issue when I tried chart search result in my web application. here the error : ReferenceError: require is not defined
[Stopper sur une erreur]

var utils = require('../utils');

charting.js (ligne 17)

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...