2675 bug cant create event rule invalid request unsupported filter field for logs timestamp #2837
No reviewers
Labels
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar!2837
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2837/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from GitHub pull request.
Original GitHub pull request: #2679
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2679
Original created: 2026-02-03T04:53:46Z
Original updated: 2026-02-03T04:55:27Z
Original head: carverauto/serviceradar:2675-bug-cant-create-event-rule---invalid-request-unsupported-filter-field-for-logs-timestamp
Original base: staging
Original merged: 2026-02-03T04:54:25Z by @mfreeman451
User description
IMPORTANT: Please sign the Developer Certificate of Origin
Thank you for your contribution to ServiceRadar. Please note, when contributing, the developer must include
a DCO sign-off statement indicating the DCO acceptance in one commit message. Here
is an example DCO Signed-off-by line in a commit message:
Describe your changes
Issue ticket number and link
Code checklist before requesting a review
PR Type
Bug fix, Enhancement
Description
Fix event rule creation by using Ash.Changeset for proper validation
Replace unsupported
timestamp:filter with SRQLtime:last_1htokenAdd support for
messagefield alias in log query filtersNavigate to rules page after successful rule creation
Apply consistent SRQL wildcard syntax with percent signs
Diagram Walkthrough
File Walkthrough
promotion_rule_builder.ex
Fix event rule creation and SRQL query syntaxweb-ng/lib/serviceradar_web_ng_web/components/promotion_rule_builder.ex
Ash.Changeset.for_createbeforeAsh.createfor proper validationtimestamp:>now-1hwithtime:last_1hin preview queriesshow.ex
Navigate to rules after rule creationweb-ng/lib/serviceradar_web_ng_web/live/log_live/show.ex
logs.rs
Add message field alias support for logsrust/srql/src/query/logs.rs
messageas supported field alias forbodyin filter collectionmessagefield support in text filter applicationmessagefield support in group field resolutionmessagefield support in stats filter clause buildingpromotion_rule_builder_test.exs
Update preview query test assertionsweb-ng/test/serviceradar_web_ng_web/components/promotion_rule_builder_test.exs
timestamp:>now-1htotime:last_1hasterisks
escaping
show_test.exs
Update rule creation success assertionweb-ng/test/serviceradar_web_ng_web/live/log_live/show_test.exs
proposal.md
Add change proposal documentationopenspec/changes/fix-log-rule-preview-time-filter/proposal.md
timestamp:>now-1hfilter rejectiontime:last_1htoken as solutionspec.md
Add rule preview specification requirementsopenspec/changes/fix-log-rule-preview-time-filter/specs/observability-rule-management/spec.md
time:last_1hfilter usage in scenariostasks.md
Add implementation task trackingopenspec/changes/fix-log-rule-preview-time-filter/tasks.md
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2679#issuecomment-3839049442
Original created: 2026-02-03T04:54:24Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
No security concerns identified
No security vulnerabilities detected by AI analysis. Human verification advised for critical code.🎫 #2675
timestampfilter field(error: "unsupported filter field for logs: 'timestamp'").
earlyoom, any severity, no service name) canbe previewed/created without triggering the unsupported
timestampfilter error.Codebase context is not defined
Follow the guide to enable codebase context checks.
Generic: Meaningful Naming and Self-Documenting Code
Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting
Status: Passed
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation
Status: Passed
Generic: Secure Error Handling
Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.
Status: Passed
Generic: Secure Logging Practices
Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.
Status: Passed
Generic: Security-First Input Validation and Data Handling
Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities
Status: Passed
Generic: Comprehensive Audit Trails
Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.
Status:
No audit logging shown: The PR adds/changes event rule creation behavior but the diff does not show any
corresponding audit trail emission (user ID, action, outcome), so compliance cannot be
confirmed from the visible changes.
Referred Code
Compliance status legend
🟢 - Fully Compliant🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2679#issuecomment-3839051958
Original created: 2026-02-03T04:55:27Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Escape wildcard characters in SRQL values
Extend the
escape_srql_valuefunction to also escape the SQL wildcard characters%and_to prevent them from being interpreted as wildcards in LIKE filters.web-ng/lib/serviceradar_web_ng_web/components/promotion_rule_builder.ex [492-496]
[To ensure code accuracy, apply this suggestion manually]Suggestion importance[1-10]: 8
__
Why: The suggestion addresses a valid security and correctness issue by pointing out that SQL wildcard characters (
%and_) in user input are not being escaped, which could lead to unintended filter behavior or injection-like issues.Use exact match for severity filter
Use an exact match for the
severity_textfilter instead of a "contains" searchby removing the
%wildcards from the filter string.web-ng/lib/serviceradar_web_ng_web/components/promotion_rule_builder.ex [756-762]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies a potential functional bug where the PR changes the
severity_textfilter to a "contains" search, which is likely incorrect for discrete values like severity levels. Reverting to an exact match improves correctness.