What is Data Enrichment?
Enrichment enhances raw event data by adding contextual information from external sources. Common enrichment use cases include:- GeoIP lookups: Add geographic information based on IP addresses
- Service mapping: Add service metadata based on identifiers
- User information: Enrich events with user profiles
- Asset inventory: Add device or infrastructure details
- Cost allocation: Add billing or organization tags
Enrichment Tables Overview
Vector supports multiple enrichment table types:- File tables: CSV or other structured files
- GeoIP tables: MaxMind GeoIP databases
- MMDB tables: Generic MaxMind database format
Setting Up Enrichment Tables
File-Based Enrichment
File-based enrichment tables load data from CSV or structured files.GeoIP Enrichment
GeoIP enrichment adds geographic information based on IP addresses.Enrichment Table Functions
VRL provides two functions for querying enrichment tables:get_enrichment_table_record
Returns a single record that matches the condition:find_enrichment_table_records
Returns all records that match the condition:Advanced Enrichment Patterns
Multi-Field Matching
Match on multiple fields for precise lookups:Date Range Enrichment
Enrich based on time ranges:Wildcard Matching
Use wildcards for flexible matching:Nested Enrichment
Perform multiple enrichment lookups:Practical Enrichment Recipes
Recipe 1: Complete GeoIP Enrichment
Recipe 2: Service Inventory Enrichment
Recipe 3: User Enrichment with Privacy
Recipe 4: Cost Allocation Tags
Dynamic Enrichment Table Updates
Enrichment tables can be reloaded without restarting Vector:Performance Considerations
Indexing
Create indexes for frequently queried fields:Caching Strategy
Handling Large Tables
Filter data
Only load necessary rows in your enrichment table. Remove historical or irrelevant data.
Consider memory limits
Large enrichment tables consume memory. Monitor Vector’s memory usage and adjust table size accordingly.
Troubleshooting Enrichment
Debugging Missing Enrichment
Validating Enrichment Tables
Common Issues
Table not found error
Cause: Enrichment table name mismatchSolution: Verify table name in configuration matches VRL function call
No matching records
Cause: Query condition doesn’t match any table rowsSolution: Check field names and values, verify data exists in table
Best Practices
- Keep tables updated: Regularly refresh enrichment data to ensure accuracy
- Use appropriate indexes: Index fields that you query frequently
- Handle missing data gracefully: Always check for errors and provide defaults
- Minimize table size: Only include necessary data and fields
- Version your data: Track changes to enrichment tables
- Test thoroughly: Validate enrichment logic with test data
- Monitor performance: Track enrichment latency and failures
- Document mappings: Maintain documentation of enrichment sources and fields
Next Steps
Enrichment is powerful when combined with other Vector features:- Routing: Use enriched data to route events to different destinations
- Filtering: Filter based on enriched fields
- Aggregation: Group and analyze events using enrichment tags
- Alerting: Trigger alerts based on enriched context