3

I want to track some client side interactions using splunk. I want to know whether it is possible using JavaScript to send some information (logs) to splunk cloud directly ?

Google analytic does the same .

Rishi
  • 1,279
  • 3
  • 20
  • 37
  • @Shakeel, http://stackoverflow.com/questions/30131870/implementing-server-logs-with-splunk Please try to look into this. – Niks May 10 '15 at 18:36

1 Answers1

4

We actually have a Splunk SDK for JavaScript that you can use, and some documentation on dev.splunk.com. You'll want to use service.log() which you can pass a string or JS object, see our example here.

Please let me know if you need further guidance

Shakeel
  • 1,039
  • 7
  • 20
  • Using Splunk SDK for JavaScript , Can I log my logs directly to splunk instead of using Universal forwarder ?? Google Analytic does the same. – Rishi May 06 '15 at 12:51
  • 2
    Yes, you don't need to use a forwarder – Shakeel May 06 '15 at 15:30
  • However, you'll probably want some kind of abstraction layer so your code is not tightly coupled to Splunk. – ATOMP Jul 27 '20 at 21:44