Log Search
Loggator provides powerful full-text search capabilities powered by Meilisearch, enabling you to find specific log entries quickly and efficiently.
Search Interface
Section titled “Search Interface”Access the search interface at http://localhost:3000/search
Basic Search
Section titled “Basic Search”Simply type your query in the search box:
errorexceptiontimeoutfailed404Meilisearch automatically:
- Finds relevant matches
- Ranks results by relevance
- Handles typos and fuzzy matching
- Highlights matching terms
Advanced Filters
Section titled “Advanced Filters”Container Filter
Section titled “Container Filter”Search logs from specific containers:
- Click the Container dropdown
- Select one or more containers
- Results are automatically filtered
Stream Filter
Section titled “Stream Filter”Filter by output stream:
- stdout: Standard output (normal logs)
- stderr: Error output (error logs)
- Both: No filter (default)
Time Range
Section titled “Time Range”Filter by timestamp:
- Last 15 minutes
- Last hour
- Last 24 hours
- Last 7 days
- Custom range (date picker)
Search Syntax
Section titled “Search Syntax”Simple Terms
Section titled “Simple Terms”Search for any word:
errorfailednginxMultiple Terms
Section titled “Multiple Terms”All terms must match (AND logic):
error timeoutnginx 404database connectionPhrases
Section titled “Phrases”Exact phrase matching with quotes:
"connection refused""out of memory""fatal error"Wildcards
Section titled “Wildcards”Not directly supported, but Meilisearch handles:
- Prefix matching:
erromatcheserror,errors - Typo tolerance:
errrostill findserror
Filtering Examples
Section titled “Filtering Examples”Find Errors
Section titled “Find Errors”Query: errorStream: stderrTime: Last 24 hoursDatabase Issues
Section titled “Database Issues”Query: connection databaseContainer: postgresTime: Last hourSpecific Error Codes
Section titled “Specific Error Codes”Query: "500 Internal Server Error"Container: nginxStream: stdoutRecent Warnings
Section titled “Recent Warnings”Query: warningTime: Last 15 minutesSearch Results
Section titled “Search Results”Each result shows:
- Timestamp: When the log was created
- Container: Which container produced it
- Stream: stdout (blue) or stderr (red)
- Message: The log message with highlighted matches
- Context: Surrounding text for better understanding
Result Actions
Section titled “Result Actions”- Copy: Copy log message to clipboard
- Scroll: Auto-scroll to follow new logs
- Export: Download results as JSON or CSV
Performance
Section titled “Performance”Indexing Speed
Section titled “Indexing Speed”Loggator indexes logs in batches:
- Batch size: 100 logs
- Batch timeout: 5 seconds
- Throughput: ~1000 logs/second
Search Speed
Section titled “Search Speed”Meilisearch provides:
- Response time: <50ms for most queries
- Typo tolerance: Built-in fuzzy matching
- Ranking: Relevance-based sorting
Scaling
Section titled “Scaling”For high-volume logging:
- Increase batch size (requires code change)
- Use SSD storage for Meilisearch
- Allocate more RAM to Meilisearch container
- Enable log rotation to limit index size
API Search
Section titled “API Search”Search programmatically via API:
curl "http://localhost:3000/api/logs/search?query=error&limit=10"See Logs API for full documentation.
Log Retention
Section titled “Log Retention”Automatic Cleanup
Section titled “Automatic Cleanup”Loggator does not automatically delete old logs. To implement retention:
Option 1: Periodic Deletion
Section titled “Option 1: Periodic Deletion”# Delete logs older than 7 dayscurl -X POST http://localhost:7700/indexes/logs/documents/delete \ -H "Authorization: Bearer $MEILISEARCH_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "filter": "timestamp < '$(($(date +%s) - 604800))'" }'Option 2: Volume Cleanup
Section titled “Option 2: Volume Cleanup”# Stop servicesdocker compose down
# Delete Meilisearch datarm -rf ./meilisearch-data/*
# Restart servicesdocker compose up -dOption 3: Scheduled Cleanup
Section titled “Option 3: Scheduled Cleanup”Add a cron job:
#!/bin/bashSEVEN_DAYS_AGO=$(($(date +%s) - 604800))curl -X POST http://localhost:7700/indexes/logs/documents/delete \ -H "Authorization: Bearer $MEILISEARCH_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"filter\": \"timestamp < $SEVEN_DAYS_AGO\"}"Search Tips
Section titled “Search Tips”1. Be Specific
Section titled “1. Be Specific”❌ Generic: log
✅ Specific: connection timeout error
2. Use Filters
Section titled “2. Use Filters”Combine search with filters for precision:
- Container + Query
- Time range + Stream
- All three together
3. Check Both Streams
Section titled “3. Check Both Streams”Some applications log errors to stdout. Always check:
- stderr first (typical errors)
- stdout second (application-specific)
4. Use Time Ranges
Section titled “4. Use Time Ranges”Narrow down issues:
- Recent problems: Last 15 minutes
- Ongoing issues: Last 24 hours
- Historical analysis: Last 7 days
5. Try Variations
Section titled “5. Try Variations”If no results:
- Remove some terms
- Try synonyms (
errorvsfailvsexception) - Check spelling
- Broaden time range
Common Searches
Section titled “Common Searches”Application Errors
Section titled “Application Errors”Query: error exception fatalStream: stderrContainer: <your-app>HTTP Errors
Section titled “HTTP Errors”Query: 500 502 503 504Container: nginxStream: stdoutDatabase Problems
Section titled “Database Problems”Query: connection refused timeout deadlockContainer: postgresOut of Memory
Section titled “Out of Memory”Query: "out of memory" OOM killedTime: Last 24 hoursAuthentication Issues
Section titled “Authentication Issues”Query: authentication failed unauthorized 401 403Troubleshooting
Section titled “Troubleshooting”No results found
Section titled “No results found”Check:
- Logs are being collected: Visit Dashboard
- Container is labeled:
docker inspect <container> | grep loggator - Spelling: Try simpler terms
- Time range: Expand the time window
- Indexing delay: Wait 5-10 seconds for recent logs
Search is slow
Section titled “Search is slow”Causes:
- Large index size (millions of logs)
- Insufficient resources
- Complex queries
Solutions:
- Implement log retention
- Increase Meilisearch RAM:
meilisearch:deploy:resources:limits:memory: 2G
- Use SSD for storage
Results not relevant
Section titled “Results not relevant”Meilisearch uses ranking. To improve:
- Use exact phrases in quotes
- Add more specific terms
- Use filters to narrow scope
Logs not appearing
Section titled “Logs not appearing”Check:
- Container is running:
docker ps - Container has label: See Docker Setup
- Loggator is running:
docker logs loggator - Meilisearch is healthy:
curl http://localhost:7700/health
Advanced Features
Section titled “Advanced Features”Highlighting
Section titled “Highlighting”Matching terms are automatically highlighted in:
- Search results
- AI chat responses
- Live log viewer
Sorting
Section titled “Sorting”Results are sorted by:
- Relevance (default)
- Timestamp (newest first)
Pagination
Section titled “Pagination”- Default: 50 results per page
- Maximum: 100 results per page
- Use API for larger result sets
Export
Section titled “Export”Download search results:
- JSON: Machine-readable format
- CSV: Spreadsheet-compatible
- Text: Plain log messages
(Feature may require implementation)
Next Steps
Section titled “Next Steps”- AI Chat Assistant - Natural language search
- Real-time Dashboard - Live log streaming
- Logs API - Programmatic access