Hi,
I am a beginner at Vega - I successfully got a "line chart" working with a inline dataset (specified with "Values") and wanted to take it to next step of getting the dataset from a json served via a URL.
When I try that, Kibana visualization area shows me:
Loading failed
http://localhost/jsons/ihs_vega.json
I have enabled
vega.enableExternalUrls: true
My json is being served by nginx on my PC. Both http and https URLs do successfully serve the json when accessed through browser.
In Vega, I tried the url to be http as well as https - both give the same problem. Note: my https server is running with a self-signed certificate (don't know if that needs to be added to some truststore to make it work).
I turned on Kibana verbose logging (logging.verbose: true), but it didn't offer any clue.
I could not find out any other parameters to turn on vega logging/tracing.
Environment Details:
Operating System: Windows 10
Kibana and Elastic version: 6.4
Complete vega code:
{
"$schema": "https://vega.github.io/schema/vega/v3.json",
"width": 500,
"height": 200,
"padding": 5,
"autosize": "pad",
"data": [
{
"name": "ihsdata",
"url": "https://localhost/jsons/ihs_vega.json",
"format": {
"type": "json",
"parse": {"RequestTime": "date"}
},
}
],
"scales": [
{ "name": "ixscale", "type": "time",
"range": "width",
"domain": {"data": "ihsdata", "field": "RequestTime"} },
{ "name": "iyscale", "type": "linear",
"range": "height", "nice": true, "zero": false,
"domain": {"data": "ihsdata", "field": "ResponseTimeMS"} }
],
"axes": [
{
"orient": "left",
"scale": "iyscale",
"grid": true,
"_tickCount": 5
},
{
"orient": "bottom",
"scale": "ixscale",
"_tickCount": 5
}
],
"marks": [
{
"type": "line",
"from": { "data": "ihsdata" },
"encode": {
"enter": {
"stroke": {"value": "#F00"}
},
"update": {
"x": {"scale": "ixscale", "field": "RequestTime"},
"y": {"scale": "iyscale", "field": "ResponseTimeMS"},
"strokeWidth": {"value": 2},
"strokeDash": {"value": [15,3]},
"opacity": {"value": 1},
"stroke": {"value": "#F00"}
},
"hover" : {
"strokeDash": {"value":[1,0]},
"stroke": {"value": "#00F"}
}
}
}
]
}
ihs_vega.json looks like:
[
{
"RequestSize":52,
"RequestType":"POST",
"AppServer":"Server4",
"ResponseTimeMS":29.6,
"RequestDate":"2018-09-11",
"RequestTime":"2018-09-11T05:00:00.000+0530",
"IHS":"IHS3"},
{
"RequestSize":51,
"RequestType":"POST",
"AppServer":"Server5",
"ResponseTimeMS":36.0,
"RequestDate":"2018-09-11",
"RequestTime":"2018-09-11T05:00:02.000+0530",
"IHS":"IHS1"},
{
"RequestSize":54,
"RequestType":"GET",
"AppServer":"Server3",
"ResponseTimeMS":37.4,
"RequestDate":"2018-09-11",
"RequestTime":"2018-09-11T05:00:07.000+0530",
"IHS":"IHS2"}
]
Can someone point me to the right direction?
Thanks so much.
24/Sep ... adding one more (related) question here
My kibana-vega visualization doesn't work for elasticsearch index as well. It doesn't give any errors, but it doesn't draw the desired picture. When my dataset points to "values
", it works properly, but when I use the dataset as
{
"name": "ihsdata",
"url": { "index": "ihs-proxy-server*"
}
}
it doesn't draw the desired picture. I don't know how to troubleshoot this.
I have one index called ihs-proxy-server-2018-09-11
and its structure is as follows:
http://localhost:9200/ihs-proxy-server-2018-09-11/?pretty=true
{
"ihs-proxy-server-2018-09-11" : {
"aliases" : { },
"mappings" : {
"doc" : {
"properties" : {
"@timestamp" : { "type" : "date" },
"@version" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } },
"AppServer" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } },
"IHS" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } },
"RequestDate" : { "type" : "date" },
"RequestSize" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } },
"RequestTime" : { "type" : "date" },
"RequestType" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } },
"ResponseTimeMS" : { "type" : "float" },
"host" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } },
"message" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } },
"path" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } }
}
}
},
"settings" : {
"index" : {
"creation_date" : "1537265561043",
"number_of_shards" : "5",
"number_of_replicas" : "1",
"uuid" : "0ohmIIhASJqxRgFVRXrvgA",
"version" : { "created" : "6040099" },
"provided_name" : "ihs-proxy-server-2018-09-11"
}
}
}
}
Thanks
-- Parag