Skip to content

Commit e4e7e30

Browse files
committed
docs: Update architecture documentation for Logstash exporter
Mark LogstashExporter as implemented (no longer "planned") and add documentation with usage example.
1 parent 5712e3d commit e4e7e30

1 file changed

Lines changed: 29 additions & 2 deletions

File tree

ARCHITECTURE.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,14 @@ let exporter = FileExporter::new(Path::new("/var/log/audit.log"))?
307307
- Graceful shutdown and flush methods
308308
- TLS support for secure audit data transmission
309309

310+
- **LogstashExporter**: Logstash exporter for ELK stack integration
311+
- TCP connection with JSON Lines protocol (newline-delimited JSON)
312+
- Optional TLS encryption for secure transmission
313+
- Automatic reconnection on connection failure
314+
- Batch support for efficient event transmission
315+
- Connection timeout handling (default: 10 seconds)
316+
- Configurable host and port
317+
310318
**OtelExporter Usage**:
311319
```rust
312320
use bssh::server::audit::otel::OtelExporter;
@@ -328,8 +336,27 @@ exporter.export(event).await?;
328336
exporter.close().await?;
329337
```
330338

331-
**Future Exporters** (planned):
332-
- Logstash exporter for centralized logging
339+
**LogstashExporter Usage**:
340+
```rust
341+
use bssh::server::audit::logstash::LogstashExporter;
342+
use bssh::server::audit::exporter::AuditExporter;
343+
use bssh::server::audit::event::{AuditEvent, EventType};
344+
345+
// Create exporter (unencrypted by default)
346+
let exporter = LogstashExporter::new("logstash.example.com", 5044)?
347+
.with_tls(true); // Enable TLS for production
348+
349+
// Export an audit event
350+
let event = AuditEvent::new(
351+
EventType::AuthSuccess,
352+
"alice".to_string(),
353+
"session-123".to_string(),
354+
);
355+
exporter.export(event).await?;
356+
357+
// Graceful shutdown
358+
exporter.close().await?;
359+
```
333360

334361
### Server CLI Binary
335362
**Binary**: `bssh-server`

0 commit comments

Comments
 (0)