Getting Data In

How can I change the output of a search job to JSON?

mwcooley
Explorer

I'm not a developer, so please bear with me. i'm using service.savedSearches.fetch, then mySavedSearch.dispatch(function(err, job) to dispatch my search. It's working, but the object returned is in JSON_ROWS.

The Splunk docs here seem to suggest I can change the output from JSON_ROWS to plain JSON, but I can't figure out how to change from the default value.

thanks,
mike

0 Karma

mwcooley
Explorer

Hi,

I figured it out, with the help of a co-worker.

I added output_mode to the job:

job.results({
count: 10,
output_mode: "JSON"
}, function(err, myObj, job) {
...
});

0 Karma
Get Updates on the Splunk Community!

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!

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

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...