Graylog2 / Graylog2/graylog2-server

Grok Pattern Changes persist after cancel

Open Beginner friendly
#27,187 0 comments 0 reactions 0 assignees View on GitHub
bug triaged
Dominant language
Java
Stars
8.1k
Forks
1.1k
Avg merge
1d 20h
Merged PRs (30d)
217

Description

## Expected Behavior
Clicking Cancel while editing a Grok Pattern should discard all changes made during the current editing session.

When opening the Grok Pattern again, the text field should contain the last saved version.
## Current Behavior
Changes made to a Grok Pattern are retained in the text field after clicking Cancel.

When the same Grok Pattern is opened again, the previously entered changes are still displayed, even though they were canceled and not saved.

## Possible Solution
Reset the form state when the edit dialog is canceled or closed without saving.

## Steps to Reproduce (for bugs)
1. Go to System → Grok Patterns.
2. Open an existing Grok Pattern for editing.
3. Modify the Grok Pattern in the text field.
4. Click Cancel.
5. Open the same Grok Pattern for editing again.
6. Observe that the previously entered changes are still present in the text field.

## Context
This can be confusing because clicking Cancel gives the expectation that all changes have been discarded. When reopening the Grok Pattern, the UI still displays the canceled changes, making it unclear whether the changes were actually saved or are only retained in the frontend state.

## Your Environment

* Graylog Version: 7.1.8
* Java Version: 21.0.12
* OpenSearch Version: 2.19.5
* MongoDB Version: 7
* Operating System: Debian 12
* Browser version: Firefox + Chrome

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

Contributor guide

Open the contributing guide

Research direction

Start in the System → Grok Patterns UI and reproduce the edit, change, Cancel, and reopen sequence described in the issue. Trace the edit dialog's form state and verify that reopening a pattern shows the last saved text, not canceled changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.