Overview
Blocklight outputs findings in NDJSON (Newline Delimited JSON) format via the file alert channel, making it compatible with virtually any log aggregation and SIEM platform. This guide shows how to integrate Blocklight’s NDJSON output with popular data pipeline tools like Vector, Logstash, and Fluentd, which can then route findings to Elasticsearch, Splunk, cloud services, and other destinations.Important: Blocklight does not have native exporters for Elasticsearch, Splunk, or cloud services. Instead, it outputs NDJSON to a file, which you then process with external tools (Vector, Logstash, Fluentd) to route to your desired destinations.
Output Formats
NDJSON (Newline Delimited JSON)
Optimized for streaming and log aggregation:timestamp: ISO 8601 timestampseverity: CRITICAL, WARNING, NOTICErule_name: Detection rule identifierchain: Blockchain nameblock_number: Block numbertx_hash: Transaction hashcontract_address: Contract address (if applicable)tags: Array of tagsreferences: Array of threat intelligence URLsmetadata: Additional context
SARIF (Static Analysis Results Interchange Format)
For CI/CD integration:Vector Integration
Vector is a high-performance observability data pipeline.Configuration
Createvector.toml:
Deploy with Docker Compose
Logstash Integration
Logstash is part of the Elastic Stack.Configuration
Createlogstash.conf:
Deploy with Docker Compose
Fluentd Integration
Fluentd is an open-source data collector.Configuration
Createfluent.conf:
Deploy with Docker Compose
Splunk Integration
Splunk HTTP Event Collector (HEC)
Configure Blocklight to send directly to Splunk:Via Fluentd/Logstash
Use the configurations above with Splunk HEC output.Splunk Search Queries
Elasticsearch Integration
Blocklight outputs NDJSON to a file. Use Vector, Logstash, or Fluentd (configured above) to send findings to Elasticsearch.Index Template
Create an index template for optimized storage:Kibana Dashboards
Import pre-built visualizations:- Finding Timeline: Time series of detections
- Severity Distribution: Pie chart by severity
- Top Rules: Bar chart of most triggered rules
- Chain Activity: Heatmap by chain and time
- Address Activity: Table of flagged addresses
Cloud Service Integration
Blocklight outputs NDJSON to a file. Use Vector, Logstash, or Fluentd to route findings to cloud services:- AWS: Use Vector’s
aws_s3oraws_cloudwatch_logssinks - Google Cloud: Use Vector’s
gcp_cloud_loggingorgcp_pubsubsinks - Azure: Use Vector’s
azure_monitorsink - Datadog: Use Vector’s
datadog_logssink
Webhook Channel: For direct HTTP integration, use Blocklight’s webhook alert channel (configured in
alerting.channels in config.yaml), not an exporter.Performance Considerations
Configure your pipeline tool (Vector/Logstash/Fluentd) for optimal performance:- Batching: Configure batch sizes in your pipeline tool (e.g., Vector’s
batchsettings) - Buffering: Enable disk buffering in your pipeline tool for reliability
- Compression: Enable compression in your pipeline tool’s sinks to reduce bandwidth
Monitoring Pipeline Health
Vector Metrics
Logstash Metrics
Fluentd Metrics
Troubleshooting
Issue: Data not appearing in destination
Check:- Blocklight is outputting data:
docker logs blocklight-core - Pipeline is reading data: Check pipeline logs
- Destination is reachable: Test connectivity
- Credentials are correct: Verify API keys/tokens
Issue: High latency
Solutions:- Increase batch sizes
- Enable compression
- Add more pipeline workers
- Use local buffering
Issue: Data loss
Solutions:- Enable persistent queues
- Increase buffer sizes
- Add retry logic
- Use at-least-once delivery
Best Practices
- Use structured logging: NDJSON for easy parsing
- Enable compression: Reduce bandwidth and storage costs
- Implement buffering: Prevent data loss during outages
- Monitor pipeline health: Track throughput and errors
- Test failover: Ensure redundancy works
- Secure credentials: Use secret management
- Rotate logs: Prevent disk space issues
- Index optimization: Use proper data types in Elasticsearch
- Partition data: By chain, severity, or time
- Archive old data: Move to cold storage after 90 days
Next Steps
- Production Deployment - Deploy Blocklight in production
- Observability - Monitor Blocklight itself
- Best Practices - Security and operational guidelines