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!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...