Mocked Data
The Mocked Data adapter generates sample log data locally without requiring any external data source. Use this adapter for testing, learning QQL, or creating demos.
When to Use
Section titled “When to Use”- Learning: Explore QQL syntax without setting up a backend
- Demos: Show Cruncher capabilities without production data
- Testing: Verify queries and configurations before connecting to real data
- Offline work: No external dependencies or network access needed
Generated Data
Section titled “Generated Data”The mocked data adapter generates synthetic log records with the following fields:
| Field | Type | Example |
|---|---|---|
timestamp | number | Unix timestamp in milliseconds |
name | string | "Alice", "Bob", "Charlie", etc. |
age | number | Random age between 20-80 |
address | string | Random street address |
tags | string | Comma-separated values like "tag1,tag2" |
key | string | Random UUID-like identifier |
field0 - field9 | number | Random numeric fields (0-9) for testing aggregations |
Example Generated Record
Section titled “Example Generated Record”{ "timestamp": 1704067200000, "name": "Alice", "age": 42, "address": "123 Main St, Springfield", "tags": "important,urgent", "key": "abc-123-def", "field0": 5, "field1": 8, "field2": 3, ...}Configuration
Section titled “Configuration”The mocked data adapter requires no parameters:
connectors: - type: mocked_data name: test_dataThat’s it! Cruncher will automatically generate data when you query this adapter.
Query Examples
Section titled “Query Examples”Basic Filtering
Section titled “Basic Filtering”where age > 40 | table name, age, addressDisplay names, ages, and addresses for people over 40.
Aggregation
Section titled “Aggregation”| stats count, avg(age) by nameGroup records by name and show count and average age.
Time Series
Section titled “Time Series”| timechart count by field0Count records over time, grouped by the field0 numeric value.
String Operations
Section titled “String Operations”where contains(address, "Street") | eval address_upper = upper(address) | table address, address_upperFind addresses containing “Street” and create an uppercase version.
Complex Pipeline
Section titled “Complex Pipeline”where age > 30 | eval age_group = if(age > 60, "senior", "adult") | stats count, avg(field1) by age_group | sort -countCategorize by age group, aggregate, and sort by count.
- Test QQL: Use mocked data to test complex queries before running them against production
- Learn functions: Practice with all QQL functions without affecting real data
- Profile switching: Include the mocked data adapter in a “testing” profile for quick switching
Ready to Try Real Data?
Section titled “Ready to Try Real Data?”Once you’ve learned QQL with mocked data, connect to real log sources:
Stream logs from local Docker containers
Query pod logs from your cluster
Query logs from Grafana Loki
For QQL reference, see QQL Documentation.