# Hawk Examples
This directory contains sample data and query examples to learn and explore all hawk features.
## 🚀 Quick Start
Lightweight sample data (~200KB total) ready to use immediately after git clone:
```bash
cd examples/small
# Explore data structure
# Basic filtering
# New feature: NOT operator
# New feature: OR operator
# New feature: Array slicing
## 📁 Dataset Overview
### small/ - Lightweight Learning Data
| `customers.json` | ~2KB | 10 | JSON | Customer management, basic queries |
| `orders.csv` | ~1KB | 25 | CSV | Sales analysis, JOIN operations |
| `products.yaml` | ~1KB | 8 | YAML | Product catalog, price analysis |
| `employees.json` | ~2KB | 15 | JSON | HR data, grouping operations |
| `ec2_instances.json` | ~2KB | 5 | JSON | AWS resources, infrastructure monitoring |
| `user_behavior.json` | ~3KB | 20 | JSON | Analytics, statistical processing |
| `survey_responses.csv` | ~2KB | 30 | CSV | Survey analysis, aggregation |
| `application.log` | ~3KB | 50 lines | TEXT | Log analysis, error extraction |
| `nginx_access.log` | ~2KB | 30 lines | TEXT | Web server logs, IP analysis |
| `urls.txt` | ~1KB | 20 lines | TEXT | URL processing, domain extraction |
| `error_messages.txt` | ~1KB | 15 lines | TEXT | Error categorization, pattern extraction |
| `nginx.conf` | ~2KB | - | TEXT | Configuration file analysis |
## 🎯 Learning Path
### Level 1: Basic Operations
```bash
# Understanding data structure
# Simple filtering
```
### Level 2: Aggregation and Grouping
```bash
# Aggregation functions
# Grouping
```
### Level 3: New Features (Logical Operations & Slicing)
```bash
# NOT operator
# OR operator
# Array slicing
```
### Level 4: Complex Text Processing
```bash
# Log analysis
# URL processing
# Configuration file analysis
### Level 5: Advanced Queries
```bash
# Multiple condition combinations
# String operations with complex logic
# Slicing with aggregation
hawk '.[]' user_behavior.json | hawk '.[0:10] | avg(.duration_seconds)'
```
## 🛠️ Larger Datasets
After mastering the basics with small sample data, practice with larger datasets:
```bash
# Generate large sample datasets (1000-10000 records)
./scripts/generate_large.sh
# Download real-world open datasets
./scripts/download_datasets.sh
# Practice with generated data
## 📊 Practical Use Cases
### Business Analytics
```bash
# Customer segment analysis
# Sales trends (by month)
### Infrastructure Monitoring
```bash
# Identify high-load instances
# Time-series error log analysis
### Data Cleaning
```bash
# Detect duplicate email addresses
# Filter out invalid data
## 🔧 Scripts
### scripts/generate_large.sh
Generate larger sample datasets:
- `--size N`: Specify number of records to generate
- `--type TYPE`: Specify data type to generate
- `--format FORMAT`: Specify output format
### scripts/download_datasets.sh
Download real-world open datasets:
- GitHub API responses
- Public API sample data
- Real log file examples
See [scripts/README.md](scripts/README.md) for detailed documentation.
## 🎓 Next Steps
1. **Master the basics**: Try all features with small/ data
2. **Practice with real data**: Use scripts/ to generate larger datasets
3. **Apply to your projects**: Use hawk with your own data files
## 💡 Tips
- **Performance**: Apply filters early for large datasets
- **Debugging**: Use `| info` to inspect data structure
- **Incremental building**: Build complex queries step by step
- **Formatting**: Use `--format table` for readable output
## 🤝 Contributing
New sample data and query examples are welcome!
---
**Related Documentation:**
- [Query Language Reference](../docs/query-language.md)
- [Getting Started Guide](../docs/getting-started.md)
- [String Operations](../docs/string-operations.md)