Skip to content

Commit f909741

Browse files
authored
Add example config for syslog receiver and add info log (open-telemetry#1747)
1 parent 155b3c4 commit f909741

3 files changed

Lines changed: 64 additions & 0 deletions

File tree

rust/otap-dataflow/configs/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,29 @@ OTLP receiver with performance metrics:
111111
- Measures and exports performance metrics
112112
- View metrics at: `http://127.0.0.1:8080/telemetry/metrics?format=prometheus&reset=false`
113113

114+
### `syslog-perf.yaml`
115+
116+
Syslog/CEF receiver with performance metrics:
117+
118+
- Receives syslog messages on UDP `0.0.0.0:5140`
119+
- Measures and exports performance metrics
120+
- View metrics at: `http://127.0.0.1:8080/telemetry/metrics?format=prometheus&reset=false`
121+
122+
To send test syslog messages:
123+
124+
```bash
125+
# Send a single syslog message
126+
echo "<134>$(date '+%b %d %H:%M:%S') testhost testtag: Test message" | nc -u -w1 127.0.0.1 5140
127+
128+
# Send multiple messages
129+
for i in {1..100}; do
130+
echo "<134>$(date '+%b %d %H:%M:%S') testhost testtag: Test message #$i" | nc -u -w1 127.0.0.1 5140
131+
done
132+
133+
# Send CEF format message
134+
echo "<134>$(date '+%b %d %H:%M:%S') testhost CEF:0|Security|IDS|1.0|100|Test Event|5|src=192.168.1.100 dst=10.0.0.50" | nc -u -w1 127.0.0.1 5140
135+
```
136+
114137
## Usage
115138

116139
You can use these configurations with the following CLI command:
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
settings:
2+
default_pipeline_ctrl_msg_channel_size: 100
3+
default_node_ctrl_msg_channel_size: 100
4+
default_pdata_channel_size: 100
5+
6+
nodes:
7+
receiver:
8+
kind: receiver
9+
plugin_urn: "urn:otel:syslog_cef:receiver"
10+
out_ports:
11+
out_port:
12+
destinations:
13+
- exporter
14+
dispatch_strategy: round_robin
15+
config:
16+
listening_addr: "0.0.0.0:5140"
17+
protocol: udp
18+
exporter:
19+
kind: exporter
20+
plugin_urn: "urn:otel:otap:perf:exporter"
21+
config:
22+
frequency: 1000
23+
cpu_usage: false
24+
mem_usage: false
25+
disk_usage: false
26+
io_usage: false
27+
28+
service:
29+
telemetry:
30+
logs:
31+
level: "info"
32+
resource:
33+
service.name: "syslog-perf"

rust/otap-dataflow/crates/otap/src/syslog_cef_receiver.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use otap_df_engine::{
2020
};
2121
use otap_df_telemetry::instrument::{Counter, UpDownCounter};
2222
use otap_df_telemetry::metrics::MetricSet;
23+
use otap_df_telemetry::otel_info;
2324
use otap_df_telemetry_macros::metric_set;
2425
use serde::Deserialize;
2526
use serde_json::Value;
@@ -128,6 +129,13 @@ impl local::Receiver<OtapPdata> for SyslogCefReceiver {
128129
mut ctrl_chan: local::ControlChannel<OtapPdata>,
129130
effect_handler: local::EffectHandler<OtapPdata>,
130131
) -> Result<TerminalState, Error> {
132+
otel_info!(
133+
"receiver.start",
134+
protocol = format!("{:?}", self.config.protocol),
135+
listening_addr = self.config.listening_addr.to_string(),
136+
message = "Starting Syslog/CEF Receiver"
137+
);
138+
131139
// Start periodic telemetry collection (1s), similar to other nodes
132140
let timer_cancel_handle = effect_handler
133141
.start_periodic_telemetry(std::time::Duration::from_secs(1))

0 commit comments

Comments
 (0)