Comments (11)
Hi @karnamonkster , I would love to help, but I don't have your data. Could you follow the first method in https://github.com/nyurik/kibana-vega-vis/blob/master/README.md#data - copy the data from the networking tab into a gist, and post the link here? Thanks!
from kibana-vega-vis.
Hi @nyurik ,
Here is a sample data that i get when i query the index in ES
https://gist.github.com/karnamonkster/b897b89b7e0f1d2f51b2e5d28f066905
from kibana-vega-vis.
@karnamonkster this is only part of the data, but it would greatly help to have a complete dataset as returned from your query. It doesn't have to have your real data, but keep all the structure (just the fields that you care to plot). Try this: in the networking tab of your browser's debug tool, find the _msearch result, and copy the whole response from the "Response" tab (I'm using Chrome, it might be called something else in other browsers).Make sure you see all the data you want to plot, and post it to the gist. It should contain the original structure, e.g. the hits and aggregations.
from kibana-vega-vis.
@nyurik i have updated the GIST. does that help?
from kibana-vega-vis.
@karnamonkster that did help to get started, but it seems something is still missing. Your graph above uses "property": "aggregations.hist.buckets"
, but your data uses aggregations.2.buckets
. But that's a minor fix. The bigger issue is that you attempt to use date_and_time
for x, but your data doesn't have this field. Your data basically has only two fields inside the aggregations: "1.value"
(float) and "key"
(string).
from kibana-vega-vis.
The query response i gave you is from an existing visualization(bar chart). Also i dont have a field called "key" in my index but was certainly part of the response for my query.
Let me update the Vega json and update you
from kibana-vega-vis.
@nyurik also basis the response code that i have submitted, can you suggest me a sample code for a simple line or bar chart using vega?
from kibana-vega-vis.
@karnamonkster , with the data you gave me, the simplest bar graph:
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"description": "A simple bar chart with embedded data.",
"data": {
"url": "https://gist.githubusercontent.com/karnamonkster/b897b89b7e0f1d2f51b2e5d28f066905/raw/fc289f36b006adc67fb4b152f03bf89074d70e5d/sample_vega.txt",
"format": {
"type": "json",
"property": "aggregations.2.buckets"
}
},
"mark": "bar",
"encoding": {
"x": { "field": "key", "type": "ordinal" },
"y": { "field": "1.value", "type": "quantitative" }
}
}
But you need to replace the url
string with an object that makes an elastic search request. The bar chart you used - see in the debug window which query it actually makes.
from kibana-vega-vis.
That is what we need, however the data url is the index that i am trying to poll.
from kibana-vega-vis.
@karnamonkster the data part is the standard elastic search query -- it highly depends on the data you have. For example, this text here (as you posted initially):
"url": {
// this is your index
"index": "scadatcp-*",
// this means that the index contains "date_and_time" timestamp field, and that the timepicker (upper right corner) will be used for this query to limit it. If the time is not relevant for this index, you can replace it with `true`.
"%context_query%": "date_and_time",
// this is the actual body of your query. The "hist" is the name of the aggregation (you used "2" instead in your data sample, so you might want to use "2" instead, or use something more descriptive in the graph and here.)
"body": {
"size": 0,
"aggs": {
"hist": {
"date_histogram": {
"field": "date_and_time",
"interval": "2h",
"time_zone": "Asia/Dubai",
"min_doc_count": 1
}
}
}
}
},
from kibana-vega-vis.
closing as inactive, feel free to comment
from kibana-vega-vis.
Related Issues (20)
- Any way to open URLs in another tab?
- Using %timefilter%: min in transform
- Kibana (6.8) Vega Force Transform Autosize Issues
- [Question]: Extracting records/data from selection HOT 4
- What time can support 4.X version
- Support Kibana 6.4.*
- Parameter maxZoom in Vega map
- vega 6.5.1 HOT 1
- Send Request at same speed of other widget (1s custom) HOT 2
- Can Vega-Kibana use a WMS service for a base map? HOT 2
- Plugin installation was unsuccessful due to error "No valid url specified." HOT 1
- Incorrect Kibana version in plugin [vega_vis]. Expected [6.5.1]; found [6.2.4] HOT 1
- Bucket Script - Sum Aggregation as filter HOT 2
- Use signal in index name (dynamic index_name) HOT 1
- versioning of the Kibana Vega declaration
- Unable to plot trend
- [Question]: Dynamic Query DSL formatting using kibanaAddFilter() HOT 1
- Not loading data from URLs without encryption HOT 1
- GeoShape visualisation from ES HOT 8
- Transform HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kibana-vega-vis.