Extended examples
All examples on this page are fully interactive! You can modify both the kJQ filter and the JSON data in real-time to see how different filters work.
Changes update instantly as you type, making it easy to experiment and learn kJQ syntax.
Type conversion transforms
Converting data types
Transform and validate data types in Kafka messages:
Parsing nested JSON
Extract data from JSON strings within Kafka messages:
Date and time operations
Current time filtering
Filter recent events using now
:
Duration-based filtering
Find sessions lasting more than 30 minutes:
Numeric operations
Statistical analysis
Find maximum transaction amounts:
Financial calculations
Calculate and validate price ranges:
String operations
Text processing pipeline
Clean and validate user input:
String validation chain
Validate email domains after cleaning:
Array operations
Data processing pipeline
Process and analyze arrays in Kafka messages:
Unique values analysis
Find unique visitor countries:
Array flattening
Process nested category structures:
Object operations
Key-value analysis
Analyze configuration changes:
Value extraction
Extract and validate configuration values:
Advanced math operations
Modulo operations
Partition data based on user ID:
Quotient and remainder
Analyze batch processing metrics:
Object functions
Contains key
Checks for the presence of a key:
Containment checks
Validate if current value exists in allowed lists:
String inside
Check if an error code exists within a larger error classification string:
String functions
Advanced string matching
Complex domain validation:
Pattern matching
Validate transaction IDs with regex:
Text analysis
Check if error messages contain specific terms:
Array to string conversion
Join tags for search indexing:
Utility operations
Empty value detection
Filter out incomplete records:
Tagged literals
Date literals
Compare against specific dates:
UUID literals
Match specific system-generated IDs:
Complex real-world examples
E-commerce order processing
Multi-condition validation for order processing:
IoT sensor data analysis
Log analysis and alerting
Parse and analyze application logs: