Skip to main content

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:
Key Fields:
  • timestamp: ISO 8601 timestamp
  • severity: CRITICAL, WARNING, NOTICE
  • rule_name: Detection rule identifier
  • chain: Blockchain name
  • block_number: Block number
  • tx_hash: Transaction hash
  • contract_address: Contract address (if applicable)
  • tags: Array of tags
  • references: Array of threat intelligence URLs
  • metadata: Additional context

SARIF (Static Analysis Results Interchange Format)

For CI/CD integration:

Vector Integration

Vector is a high-performance observability data pipeline.

Configuration

Create vector.toml:

Deploy with Docker Compose

Logstash Integration

Logstash is part of the Elastic Stack.

Configuration

Create logstash.conf:

Deploy with Docker Compose

Fluentd Integration

Fluentd is an open-source data collector.

Configuration

Create fluent.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:
  1. Finding Timeline: Time series of detections
  2. Severity Distribution: Pie chart by severity
  3. Top Rules: Bar chart of most triggered rules
  4. Chain Activity: Heatmap by chain and time
  5. 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_s3 or aws_cloudwatch_logs sinks
  • Google Cloud: Use Vector’s gcp_cloud_logging or gcp_pubsub sinks
  • Azure: Use Vector’s azure_monitor sink
  • Datadog: Use Vector’s datadog_logs sink
See the Vector/Logstash/Fluentd configurations above for examples. Configure these tools to read from Blocklight’s NDJSON output file and route to your cloud service.
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 batch settings)
  • 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:
  1. Blocklight is outputting data: docker logs blocklight-core
  2. Pipeline is reading data: Check pipeline logs
  3. Destination is reachable: Test connectivity
  4. 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

  1. Use structured logging: NDJSON for easy parsing
  2. Enable compression: Reduce bandwidth and storage costs
  3. Implement buffering: Prevent data loss during outages
  4. Monitor pipeline health: Track throughput and errors
  5. Test failover: Ensure redundancy works
  6. Secure credentials: Use secret management
  7. Rotate logs: Prevent disk space issues
  8. Index optimization: Use proper data types in Elasticsearch
  9. Partition data: By chain, severity, or time
  10. Archive old data: Move to cold storage after 90 days

Next Steps