Graylog2 / Graylog2/graylog2-server

Custom field name validation in Event Definition wizard happens too late

Open
#25,427 2 comments 0 reactions 0 assignees View on GitHub
bug test-day triaged UX improvement
Dominant language
Java
Stars
8.1k
Forks
1.1k
Avg merge
1d 20h
Merged PRs (30d)
217

Description

## Expected Behavior
When creating a custom field in the Event Definition wizard, invalid field names should be validated immediately.

If a *Field* name contains invalid characters such as spaces, the user should receive a clear validation error:
- while typing the field name, or at least
- when clicking **"Add custom field"**

The invalid *Field* should not appear as successfully created.

In addition, the validation message should be shown close to the relevant input field so the user can understand and correct the problem immediately.

## Current Behavior
When creating a custom field in the Event Definition wizard, it is possible to enter a field name containing a space, for example `min temp`, and click **"Add custom field"` without receiving an error.

The field is shown as if it was created successfully.

Only when clicking **"Create Event Definition"** at the end of the wizard does Graylog display an error message:

```text
We found some errors!
Please correct the following errors before saving this Event Definition:

Event Definition field_spec contains invalid message field "min temp". Valid message field characters are: a-z, A-Z, 0-9, ., -, and @. No spaces are allowed.
```

This validation happens too late in the process.

In addition, the error is easy to miss because it is shown after the user clicks **"Create Event Definition"**, while the user may already be scrolled further down the page. In that situation, the user mainly notices a cryptic toaster notification instead of the actual validation message.

## Possible Solution
Validate custom field names earlier in the flow:
- ideally while the user is typing
- or at least when clicking **"Add custom field"**

Possible UI improvements:
- show an inline validation error directly next to the field name input
- prevent adding the custom field until the name is valid
- make the toaster message more explicit, or automatically scroll to the invalid field
- clearly document the allowed character set near the input

This would prevent invalid state from being added to the wizard and make the error easier to understand.

## Steps to Reproduce (for bugs)
1. Navigate to **Alerts → Event Definitions**
2. Start creating a new Event Definition
3. In the wizard, add a custom field
4. Enter a field name containing a space, for example `min temp`
5. Click **"Add custom field"**
6. Observe that the field appears to be added successfully
7. Continue to the end of the wizard and click **"Create Event Definition"**
8. Observe that validation only happens at this point and the actual error message is easy to miss

## Context
This is confusing because the UI accepts invalid input in an earlier step and only rejects it at the very end of the workflow. That makes the wizard feel unreliable and forces users to backtrack to understand what went wrong.

The resulting toaster notification is also not helpful enough on its own, especially if the real validation message is outside the current scroll position.

## Your Environment
* Graylog Version: 7.1 alpha 3

## Checklist
[] This issue fix need to be backported.
[] Does this issue have **security** implications?

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.