Splunk Dev

Get events into splunk using Javascript SDK - Internet Explorer 8

yitzarad
Path Finder

Hi,

I'm trying to send data into splunk index, using splunkjs.Service.Index.submitEvent method, as shown in the example (look for "To add data directly to an index" paragraph). It works fine under FF and Chrome, but not in IE8.

When trying to execute myindexes.item("test_index"), the myindexes is null. I verified that it is OK and non-null before the fetch callback is executed.

In the console, I see an error saying "Error in parsing JSON", without any additional data/params.

Any ideas?


Edit:

I have no IE8 to reproduce it right now. When running in IE10 everything is working fine (like FF and Chrome). But, when choosing compatibility view (which simulates IE7), the problem does occur. This can be reproduced easily, no specific configuration is required.

the code is very simple (almost purely copied from the example):


var http = new splunkjs.ProxyHttp("/proxy");

// Create a Service instance and log in
var service = new splunkjs.Service(http, {
username: "admin",
password: "changeme",
scheme: "https",
host: "localhost",
port:"8089",
version:"5.0"
});

// Get the collection of indexes
var myindexes = service.indexes();
// Get an index to send events to
myindexes.fetch(function(err, myindexes) {
var myindex = myindexes.item("main");
// Submit an event to the index
myindex.submitEvent("A new event", {
sourcetype: "mysourcetype"
}, function(err, result, myindex) {
console.log("Submitted event: ", result);
});
});

The normal network traffic goes like this ("output_mode=json" is omitted for readability):


(1) POST /proxy/services/auth/login
request body contains username and password
response contains a sessionKey

(2) GET /proxy/services/data/indexes?count=0
response contains a list of indexes details

(3) POST /proxy/services/receivers/simple?sourcetype=mysourcetype&index=main
request body contains the text of the event to be indexed
response contains a confirmation about the indexed event

When fails, the network traffic stops after the first request. the response seems to be alright: {"sessionKey":"................................"}

Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...