Skip to content

feat: Add seqcli events delete command#445

Open
mloskot wants to merge 1 commit intodatalust:devfrom
mloskot:ml/feat/command-events-delete
Open

feat: Add seqcli events delete command#445
mloskot wants to merge 1 commit intodatalust:devfrom
mloskot:ml/feat/command-events-delete

Conversation

@mloskot
Copy link
Contributor

@mloskot mloskot commented Feb 19, 2026

The events delete command is modelled after the seqcli search and accepts date range as well as filter expressions.

The events delete command is covered with e2e tests.

The idea of adding delete command came up in this thread:

seqcli delete or seqcli events delete

Since there search and ingest are not sub-commands of seqcli events, I decided to follow the convention and add seqcli delete instead of seqcli events delete.

I eventually refactored the command into seqcli events delete, see discussion in #445 (review)

Testing

$  dotnet run -- Delete.* --docker-server --verbose
dotnet run -- Delete.* --docker-server --verbose
Using launch settings from /home/mloskot/workshop/seq/seqcli/test/SeqCli.EndToEnd/Properties/launchSettings.json...
TESTING /home/mloskot/workshop/seq/seqcli/src/SeqCli/bin/Debug/net10.0/seqcli.dll
RUNNING EventsDeleteWithDateRangeNoneTestCase             
RUNNING EventsDeleteTestCase                              
RUNNING EventsDeleteWithDateRangeSomeTestCase             
RUNNING EventsDeleteWithFilterTestCase                    
PASS
RUNNING EventsDeleteWithDateRangeAllTestCase              
PASS
PASS
PASS
PASS
Done; 5 total, 5 passed, 0 failed, 0 skipped.

I have also tested seqcli events delete against live server running Seq 2025.2.15571.

Examples

$ seqcli events delete -f "app='myservice'"
$ seqcli events delete --start=2026-02-11T23:00:00.01Z --end=2026-02-12T23:59:59Z
$ seqcli events delete --start=2026-02-11T23:00:00.01Z --end=2026-02-12T23:59:59Z --filter="app='myservice'"

Copy link
Member

@nblumhardt nblumhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks, just some minor comments.

I think this should still go under events delete; although it would be the odd one out right now, it's a fringe scenario (retention policies are preferred and perform much better), while the top-level commands are generally for day-to-day scenarios. It's also possible we'll end up with a metrics delete in the future.

(If I could go back in time I'd probably not put any commands at the root level, but that ship sailed long ago 😅 .)

@mloskot
Copy link
Contributor Author

mloskot commented Feb 19, 2026

@nblumhardt

(If I could go back in time I'd probably not put any commands at the root level, but that ship sailed long ago 😅 .)

I kind of sensed that. Still, I wanted to remain explicit with my decision process and provoke exactly the discussion we are having here 😅

Looks great, thanks, just some minor comments.
I think this should still go under events delete;

Yup, that's a good idea indeed and regarding your other feedback, good one, thanks. I will refactor the PR tomorrow (I'm in CET).

@mloskot mloskot force-pushed the ml/feat/command-events-delete branch 2 times, most recently from 49014ee to 57410c1 Compare February 20, 2026 11:44
@mloskot mloskot changed the title feat: Add seqcli delete command feat: Add seqcli events delete command Feb 20, 2026
@mloskot mloskot force-pushed the ml/feat/command-events-delete branch from 57410c1 to 8503562 Compare February 20, 2026 11:46
@mloskot
Copy link
Contributor Author

mloskot commented Feb 20, 2026

Hi @nblumhardt,
I think I've applied all the suggestions.

I may be lacking some .NET fu here, but I'm not sure why the Delete.* pattern can find tests, whereas EventsDelete.* does not:

$ dotnet run -- EventsDelete.* --docker-server --verbose
Using launch settings from /home/mloskot/workshop/seq/seqcli/test/SeqCli.EndToEnd/Properties/launchSettings.json...
TESTING /home/mloskot/workshop/seq/seqcli/src/SeqCli/bin/Debug/net10.0/seqcli.dll
Done; 0 total, 0 passed, 0 failed, 0 skipped.

The `events delete` command is modelled after the `seqcli search`
and accepts date range as well as filter expressions.

The `events delete` command is covered with e2e tests.

The idea of adding delete command came up in this thread:
- datalust/seq-tickets#2529

Signed-off-by: Mateusz Łoskot <mateusz@loskot.net>
@mloskot mloskot force-pushed the ml/feat/command-events-delete branch from 8503562 to 1128e7a Compare February 20, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments