Getting Data In

How to work with JSON file from JS?

rendie
Path Finder

Hi,
I have to write some information to JSON file because of this method comfortable for me, but when I am trying read JSON file from JS file I have an error with 404 code.
How to fix it? How work with JSON file from JS file in /appserver/static?
Thanks.

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@rendie

Can you please share your sample javascript code for JSON file read/write opearation??

0 Karma

rendie
Path Finder

@kamlesh_vaghela

require([
"splunkjs/mvc", "jquery",
'splunk.util', 'splunkjs/mvc/tableview',
'splunkjs/mvc/searchmanager',
'splunkjs/mvc/simplexml/ready!' ], function(mvc, $, splunkUtil,
TableView ) { var request = new
XMLHttpRequest(); request.open('GET',
'saved.json', true); request.send();
console.log(request.statusText); });

JSON and JS in one folder, is /appserver/static

0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...