Skip to content

Instantly share code, notes, and snippets.

@nyurik nyurik/webinar-demo1.hjson
Last active Feb 22, 2018

Embed
What would you like to do?
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: {
size: 10000
_source: ["@timestamp", "extension"]
}
}
format: {property: "hits.hits"}
}
// Parse timestamp and copy extension into new variables
transform: [
{calculate: "toDate(datum._source['@timestamp'])", as: "time"}
{calculate: "datum._source.extension", as: "ext"}
]
// Draw results as colored circles
mark: circle
encoding: {
x: {
field: time
type: temporal
axis: {title: null, labelAngle: 30}
}
y: {
field: ext
type: nominal
axis: {title: null}
}
color: {field: "ext", type: "nominal"}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.