Skip to content

Breser - a simple query syntax

Breser stands for Business Rules & Expression Syntax for Easy Retrieval.

Breser is a powerful and flexible query language designed for efficient log processing and structured data filtering. It provides an intuitive syntax that combines the familiarity of programming languages with the specific needs of log analysis and data querying.

Motivation

Modern applications generate vast amounts of logs and structured data that need to be efficiently filtered, analyzed, and processed. Traditional text-based grep or regex approaches often fall short when dealing with structured data, while full programming languages can be overly complex for simple querying needs. Breser bridges this gap by providing:

  • A simple yet powerful syntax for complex data queries
  • Strong type safety to prevent runtime errors
  • Efficient processing of structured log data
  • Extensibility through custom functions
  • Built-in support for common log analysis operations

Key Use Cases

1. Log Analysis and Filtering

js
severity == "error" and timestamp > "2023-01-01"

Filter logs to find critical database errors that occurred after a specific date.

2. Security Event Processing

js
@isIPV6(sourceIP) and severity == "high" and 
category in ("authentication", "authorization")

Monitor security events by filtering high-severity authentication attempts from IPv6 addresses.

3. User Activity Monitoring

js
action in ("delete", "modify") and resource starts "prod-"

Monitor administrative actions on production resources.

4. Data Validation and Processing

js
(status not in ("valid", "pending")) or 
(@length(description) < 10 and priority == "high")

Identify records that need attention based on their status and content validation.

Key Features

  1. Intuitive Syntax: Familiar operators and expressions that are easy to read and write
  2. Structured Data Support: Deep object traversal with dot notation and array access
  3. Rich Comparison Operations: Full set of comparison operators for different data types
  4. String Operations: Built-in functions for common string matching needs
  5. Collection Operations: Efficient membership testing with in and not in operators
  6. Extensible Function System: Custom functions for domain-specific operations
  7. Strong Type System: Reliable evaluation with proper type checking
  8. Clear Error Handling: Helpful error messages for debugging

The expression language serves as a foundation for building powerful log analysis tools, data processing pipelines, and monitoring systems while maintaining simplicity and usability for end users.