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!

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 ...