Skip to content

Instantly share code, notes, and snippets.

View nyurik's full-sized avatar

Yuri Astrakhan nyurik

View GitHub Profile
@nyurik
nyurik / webinar-demo1.hjson
Last active February 22, 2018 21:23
Vega Webinar - scatter plot showing web requests for various file types
{
$schema: https://vega.github.io/schema/vega-lite/v2.json
data: {
// Get 10000 documents from ES
url: {
%context%: true
%timefield%: @timestamp
index: logstash-*
body: {
@nyurik
nyurik / webinar-demo2.hjson
Created February 22, 2018 21:24
Vega Webinar - area chart from multivariable composite aggregation
{
$schema: https://vega.github.io/schema/vega-lite/v2.json
data: {
url: {
index: logstash-*
%context%: true
%timefield%: @timestamp
body: {
size: 0
aggs: {
@nyurik
nyurik / webinar-earthquakes.json
Created February 22, 2018 21:29
Vega Webinar - copy of standard example with absolute URLs
// Copied from https://vega.github.io/vega/examples/earthquakes/
{
"$schema": "https://vega.github.io/schema/vega/v3.json",
"signals": [
{"name": "quakeSize", "value": 6},
{
"name": "rotate0",
"value": 90,
"bind": {"input": "range", "min": -180, "max": 180}
{
$schema: https://vega.github.io/schema/vega/v3.json
data: [
{
name: esdata
url: {
%context%: true
%timefield%: @timestamp
index: logstash-*
body: {
{
$schema: https://vega.github.io/schema/vega/v3.0.json
config: {
kibana: {type: "map", latitude: 25, longitude: -70, zoom: 3}
}
data: [
{
name: table
url: {
index: kibana_sample_data_flights
@nyurik
nyurik / vega_img.json
Created July 10, 2018 15:49
vega with conditional image (centered and stretched to the largest size preserving aspect ration)
{
"$schema": "https://vega.github.io/schema/vega/v4.json",
"width": 200,
"height": 200,
"padding": 5,
"marks": [
{
"type": "image",
"encode": {
"enter": {
@nyurik
nyurik / rotating_world_map.hjson
Created November 13, 2018 19:32
Kibana rotating cloropleth world map
{
$schema: https://vega.github.io/schema/vega/v3.json
padding: 10
config: {
kibana: {tooltips: false}
}
signals: [
{
name: rotation
value: 65
{
$schema: https://vega.github.io/schema/vega/v3.json
padding: 10
config: {
kibana: {tooltips: false}
}
signals: [
{
name: rotation
value: 65

Keybase proof

I hereby claim:

  • I am nyurik on github.
  • I am nyurik (https://keybase.io/nyurik) on keybase.
  • I have a public key ASA_DNz0UNVjjeDMAIOHOLYL2y2ybFNWIMgB9dkX5A5j3Qo

To claim this, I am signing this object:

@nyurik
nyurik / kibana_vega_question_guide.md
Last active June 3, 2020 21:46
How to submit Kibana Vega question

How to submit Kibana Vega question

It is usually very difficult to debug Vega questions without having your data. To make it easier, please follow these steps to include data with your graph when posting:

  • Reduce your data query to the smallest possible dataset, e.g. set the time range to 15 minutes. It will work as long as it is not empty and represents your data well enough.
  • Open Browser Debugger (for Chrome, right click and click Inspect)
  • Switch to the Console tab
  • Copy the right command, paste it in the console at the > symbol and hit enter (check the schema in your graph to see if you use Vega or Vega-Lite)