# Loading Vega-lite schema + data from local

**URL:** https://discuss.elastic.co/t/loading-vega-lite-schema-data-from-local/280249
**Category:** Kibana
**Tags:** vega
**Created:** [August 2, 2021, 6:26pm UTC](https://discuss.elastic.co/t/loading-vega-lite-schema-data-from-local/280249 "2021-08-02T18:26:32Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![sohenrane](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@sohenrane](https://discuss.elastic.co/u/sohenrane)
#### Post date: [August 2, 2021, 6:26pm UTC](https://discuss.elastic.co/t/loading-vega-lite-schema-data-from-local/280249/1 "2021-08-02T18:26:32Z")

</div>

{  
"$schema": "file:///C:/Users/custom4me/Downloads/ELK/v5.json",  
"title": "Event counts from MAIN index",  
"data": {  
"url": "file:///C:/Users/custom4me/Downloads/ELK/seattle-weather.csv"  
}  
}

How to load from local FS?

---

<div class="post-metadata">

### Author: ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)
#### Post date: [August 2, 2021, 7:24pm UTC](https://discuss.elastic.co/t/loading-vega-lite-schema-data-from-local/280249/2 "2021-08-02T19:24:30Z")

</div>

I am not sure you can. Last I tried I had to host the file on a web server. I guess you could host it on Kibana's but that's not best practice.

Also your `$schema` field I don't think works like that. It's a string and not an actual location to a file. So use the below instead

`"$schema": "https://vega.github.io/schema/vega/v5.json"`

---

<div class="post-metadata">

### Author: ![sohenrane](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@sohenrane](https://discuss.elastic.co/u/sohenrane)
#### Post date: [August 2, 2021, 8:21pm UTC](https://discuss.elastic.co/t/loading-vega-lite-schema-data-from-local/280249/3 "2021-08-02T20:21:07Z")

</div>

Aaron,

Issue we have is using on Staging Linux machine that does have access to the Internet.

We may not get permission to configure a firewall security rule to allow to fetch from the Internet.

We are thinking local loading (best option) or configuring an internal webservice that will load the files.

Will try the internal webservice loading for "$schema" as well as "url" and check.

---

<div class="post-metadata">

### Author: ![sohenrane](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@sohenrane](https://discuss.elastic.co/u/sohenrane)
#### Post date: [August 2, 2021, 8:52pm UTC](https://discuss.elastic.co/t/loading-vega-lite-schema-data-from-local/280249/4 "2021-08-02T20:52:42Z")

</div>

Apparently, even loopback webservice does not load the files.

{  
"$schema": "[http://127.0.0.1:8000/v5.json](http://127.0.0.1:8000/v5.json)",  
"title": "Seattle Weather, 2012-2015",  
"data": {  
"url": "[http://127.0.0.1:8000/seattle-weather.csv](http://127.0.0.1:8000/seattle-weather.csv)"  
}  
}

---

<div class="post-metadata">

### Author: ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)
#### Post date: [August 2, 2021, 10:46pm UTC](https://discuss.elastic.co/t/loading-vega-lite-schema-data-from-local/280249/5 "2021-08-02T22:46:38Z")

</div>

Your schema needs to be exactly like this It's a string and not a URL. So it doesn't try to reach out to the internet. I did the same thing first time I started so I get this. 🙂

`"$schema": "https://vega.github.io/schema/vega/v5.json"`

---

<div class="post-metadata">

### Author: ![sohenrane](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@sohenrane](https://discuss.elastic.co/u/sohenrane)
#### Post date: [August 3, 2021, 8:42pm UTC](https://discuss.elastic.co/t/loading-vega-lite-schema-data-from-local/280249/6 "2021-08-03T20:42:47Z")

</div>

your first response made it clear for "$schema" being a String and not an URI. Thanks.

As for "data.url", is there a way to load from local without webservice like placing the file in a certain directory?

Tried "data.url" = "[http://127.0.0.1:8000/seattle-weather.csv](http://127.0.0.1:8000/seattle-weather.csv)", but did not work using (v2.7.17) 'python -m SimpleHTTPServer 8000' from the actual FS folder of "seattle-weather.csv".

---

<div class="post-metadata">

### Author: ![sohenrane](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@sohenrane](https://discuss.elastic.co/u/sohenrane)
#### Post date: [August 5, 2021, 5:22pm UTC](https://discuss.elastic.co/t/loading-vega-lite-schema-data-from-local/280249/7 "2021-08-05T17:22:31Z")

</div>

got it working via CORS. and it prevents directory traversal.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 2, 2021, 5:23pm UTC](https://discuss.elastic.co/t/loading-vega-lite-schema-data-from-local/280249/8 "2021-09-02T17:23:20Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
