Graylog2 / Graylog2/graylog2-server
Entity list layout preferences cannot hold two values for the same filter key
- Dominant language
- Java
- Stars
- 8.1k
- Forks
- 1.1k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 217
Description
A predefined table view cannot filter on two values of the same column. Loading such a view fails. No shipped view does this today, so nothing is broken for users right now, but it blocks building views that need it.
## Why
Predefined views are the mechanism behind tabs like "System Alerts" on the Alerts page. Any tab that has to show more than one kind of entity needs two values on the same filter, and that cannot currently be expressed. It blocks Graylog2/graylog-plugin-enterprise#15610.
## How
`filtersFromJson` in `graylog2-web-interface/src/components/common/EntityDataTable/hooks/useUserLayoutPreferences.ts` reads the already collected values with property access on an Immutable map, which always yields `undefined`, so the second value for a key throws a `TypeError`.
To reproduce, store an `entity_list_preferences` layout document with `filters: ["priority:2", "priority:3"]` and open the matching entity table.
Separately, the same function splits each entry on `:` with no limit, so a filter value containing a colon is silently truncated. No current value contains one.
Contributor guide
Research direction
Start with filtersFromJson in graylog2-web-interface/src/components/common/EntityDataTable/hooks/useUserLayoutPreferences.ts and reproduce the issue using an entity_list_preferences document containing filters ["priority:2", "priority:3"]. Done means both values for one filter key load without a TypeError, and filter values containing a colon are not truncated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100