Dashboards & Visualizations

KVStore on remote server

dokaas_2
Path Finder

So this is bugging me. I've got the following script in an HTML form in Splunk:

//
// 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("Case Opened - lit", {
              sourcetype: "notes"
          }, function(err, result, myindex) {
            console.log("Submitted event: ", result);
          });
        });

//

Which works. But, if I add a line to use a variable instead of a literal string such as:

//
// Get the collection of indexes
var myindexes = service.indexes();
var event = "Date=" + form_Date + ", BacklogID=" + form_BacklogID + ", evtID=" + form_evtID + ", Comments=" + form_Comments + ", Author=" + form_Author;

        // 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(event, {
              sourcetype: "siem:alarm:notes"
          }, function(err, result, myindex) {
            console.log("Submitted event: ", result);
          });
        });

//

it doesn't give an error, but it doesn't add the record either. I've debugged and stepped into the code and the var event does have data, but nothing gets pushed to the index.

What gives? Anybody have an idea?

Tags (4)
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 ...