Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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: {
table: {
composite: {
size: 10000
sources: [
{
time: {
date_histogram: {
field: @timestamp
interval: {%autointerval%: 500}
}
}
}
{
ext: {
terms: {field: "extension.raw"}
}
}
]
}
}
}
}
}
format: {property: "aggregations.table.buckets"}
}
transform: [
{calculate: "datum.key.time", as: "time"}
{calculate: "datum.key.ext", as: "ext"}
]
mark: area
encoding: {
x: {
field: time
type: temporal
axis: {title: null}
}
y: {
axis: {title: "Document count"}
field: doc_count
type: quantitative
}
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.