Getting Data In

Reading a JSON file from HTML or Javascript

chaninphx
Path Finder

Hi all! I'm trying to find a way to get my javascript file called mapsScript.js in my appserver/static folder to read a json file. The only thing is I've been putting my json file called buildings.json in multiple folders and even the same folder as my javascript file and it still will won't read it. Can someone tell me where I should put my json file, and what the best way to read it is. I've searched all over for another question like this or for a tutorial and I couldn't find one. Thanks!

var jsonObj = $.getJSON("buildings.json");

0 Karma

sbbadri
Motivator

@chaninphx

Splunk UF is capable of reading JSON file. You use props.conf and transforms.conf to extract fields from your json file.

props.conf

_json ]
SHOULD_LINEMERGE=true
NO_BINARY_CHECK=true
CHARSET=UTF-8
INDEXED_EXTRACTIONS=json
KV_MODE=none
category=Structured
description=JavaScript Object Notation format. For more information, visit http://json.org/
disabled=false
pulldown_type=true

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...