Skip to content

Instantly share code, notes, and snippets.

@thomasneirynck
Created June 11, 2025 21:49
Show Gist options
  • Save thomasneirynck/8e857803bf39b5097ae806c9ce9ed112 to your computer and use it in GitHub Desktop.
Save thomasneirynck/8e857803bf39b5097ae806c9ce9ed112 to your computer and use it in GitHub Desktop.
Lens panels after
[
{
"type": "lens",
"config": {
"title": "Bar vertical stacked (ESQL)",
"visualizationType": "lnsXY",
"state": {
"dataSources": {
"27f63689-18d8-4356-b608-6da242da3b00": {
"type": "esql",
"query": "FROM kibana_sample_data_logs | STATS AVG(bytes) by BUCKET(timestamp, 100, ?_tstart, ?_tend)"
}
},
"visualization": {
"layers": [
{
"layerType": "data",
"dataSource": "27f63689-18d8-4356-b608-6da242da3b00",
"seriesType": "bar_stacked",
"xAccessor": "BUCKET(timestamp, 100, ?_tstart, ?_tend)",
"accessors": ["AVG(bytes)"]
}
]
}
}
}
},
{
"type": "lens",
"config": {
"title": "Bar vertical stacked (dataview)",
"visualizationType": "lnsXY",
"state": {
"dataSources": {
"8f8fdf1c-8b58-4e67-8f38-f0c811bf22d7": {
"type": "data_view",
"data_view": {
"type": "ad_hoc",
"config": {
"name": "kibana_sample_data_logs_ad_hoc",
"timeFieldName": "@timestamp",
"indexPattern": "kibana_sample_data_logs"
}
},
"columns": [
{
"label": "@timestamp",
"dataType": "date",
"operationType": "date_histogram",
"sourceField": "@timestamp"
},
{
"label": "Average of bytes",
"operationType": "average",
"sourceField": "bytes"
}
]
}
},
"visualization": {
"layers": [
{
"layerType": "data",
"dataSource": "8f8fdf1c-8b58-4e67-8f38-f0c811bf22d7",
"seriesType": "bar_stacked",
"xAccessor": 0,
"accessors": [1]
}
]
}
}
}
}
]
@thomasneirynck
Copy link
Author

thomasneirynck commented Jun 11, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment