Dashboards & Visualizations

How do we use Javascript to connect and send data to HTTP Event Collector?

sweatherly
Engager

We would like to know what is the simplest way to use JavaScript in a basic web application to send data to Splunk? I've tried a few examples without success over the past few days and it's just gotten frustrating. Does anyone have any simple example of getting this working with XMLHttpRequest functions?

Thanks!

0 Karma

niketn
Legend

@sweatherly have you tried Overview of Splunk Logging for JavaScript on Splunk Dev which is currently under beta?

http://dev.splunk.com/view/splunk-logging-javascript/SP-CAAAE6U

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

sweatherly
Engager

Additional details: When I follow the instructions exactly, we are getting the following:

On the step where it states:

npm install --save splunk-logging

this is the result...

npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "splunk-logging" under a package
npm ERR! also called "splunk-logging". Did you name your project the same
npm ERR! as the dependency you're installing?

How do we get past this? Is there something we are missing?

0 Karma

sweatherly
Engager

Hi folks, we anticipate that no one has experienced this? Any clue would assist if this has been seen before with the installer.

0 Karma

sweatherly
Engager

Yes, I have. Have you gotten this to work?

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...