Graylog2 / Graylog2/graylog2-server

Dashboards create widgets with null timerange

Open
#7,311 0 comments 0 reactions 0 assignees View on GitHub
bug High Prio
Dominant language
Java
Stars
8.1k
Forks
1.1k
Avg merge
1d 20h
Merged PRs (30d)
217

Description

Using predefined aggregations to create widgets in a Dashboard will create widgets with `null` time range, which is inconsistent with widgets created through the aggregation builder or exported from a Search.

Here is an example of two message count widgets (created from _sidebar -> create -> predefined aggregation_) how they are stored in MongoDB. The first was created in a Dashboard, the second was created in a Search and then exported to a Dashboard:

```json
{
"id" : "2c39c749-c0ec-42ec-b28a-ce6105af0549",
"type" : "aggregation",
"timerange" : null,
"query" : null,
"streams" : [],
"config" : {
"row_pivots" : [],
"column_pivots" : [],
"series" : [
{
"config" : {
"name" : "Message Count"
},
"function" : "count()"
}
],
"sort" : [],
"visualization" : "numeric",
"rollup" : true,
"event_annotation" : false
}
},
{
"id" : "44832abd-a172-4e38-aa8d-bef2e66ed592",
"type" : "aggregation",
"timerange" : {
"type" : "relative",
"range" : 300
},
"query" : {
"type" : "elasticsearch",
"query_string" : ""
},
"streams" : [],
"config" : {
"row_pivots" : [
{
"field" : "timestamp",
"type" : "time",
"config" : {
"interval" : {
"type" : "auto",
"scaling" : null
}
}
}
],
"column_pivots" : [],
"series" : [
{
"config" : {},
"function" : "count()"
}
],
"sort" : [],
"visualization" : "bar",
"rollup" : true,
"event_annotation" : false
}
}
```

Creating the same aggregation through the aggregation builder also has the `timerange` property set.

This may influence other entities relying on the widget time range, like Reporting.

## Steps to Reproduce (for bugs)
1. Go to search, open sidebar and create a predefined "message count"
2. Export search to Dashboard
3. Go to the new Dashboard, open sidebar and create a predefined "message count"
4. Save Dashboard
4. Check that both widgets have different time ranges

## Your Environment
* Graylog Version: 3.2.0-rc.1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.