@@ -27,6 +27,7 @@ pub use opentelemetry::metric::OpentelemetryMetrics;
2727pub use opentelemetry:: trace:: OpentelemetryTraces ;
2828pub use splunk_hec:: SplunkHec ;
2929pub use static_chunks:: StaticChunks ;
30+ pub use static_timestamped:: StaticTimestamped ;
3031pub use statik:: Static ;
3132pub use syslog:: Syslog5424 ;
3233
@@ -41,6 +42,7 @@ pub mod opentelemetry;
4142pub mod procfs;
4243pub mod splunk_hec;
4344pub mod static_chunks;
45+ pub mod static_timestamped;
4446pub mod statik;
4547pub mod syslog;
4648pub mod trace_agent;
@@ -139,6 +141,23 @@ pub enum Config {
139141 /// all files under it (non-recursively) will be read line by line.
140142 static_path : PathBuf ,
141143 } ,
144+ /// Generates static data grouped by second; each block contains one
145+ /// second's worth of logs as determined by a parsed timestamp prefix.
146+ StaticTimestamped {
147+ /// Defines the file path to read static variant data from. Content is
148+ /// assumed to be line-oriented.
149+ static_path : PathBuf ,
150+ /// Chrono-compatible timestamp format string used to parse the leading
151+ /// timestamp in each line.
152+ timestamp_format : String ,
153+ /// Emit a minimal placeholder block (single newline) for seconds with
154+ /// no lines. When false, empty seconds are skipped.
155+ #[ serde( default ) ]
156+ emit_placeholder : bool ,
157+ /// Optional starting line offset; lines before this index are skipped.
158+ #[ serde( default ) ]
159+ start_line_index : Option < u64 > ,
160+ } ,
142161 /// Generates a line of printable ascii characters
143162 Ascii ,
144163 /// Generates a json encoded line
@@ -179,6 +198,8 @@ pub enum Payload {
179198 Static ( Static ) ,
180199 /// Static file content, chunked into lines that fill blocks as closely as possible.
181200 StaticChunks ( StaticChunks ) ,
201+ /// Static file content grouped into one-second blocks based on timestamps
202+ StaticTimestamped ( StaticTimestamped ) ,
182203 /// Syslog RFC 5424 format
183204 Syslog ( Syslog5424 ) ,
184205 /// OpenTelemetry traces
@@ -208,6 +229,7 @@ impl Serialize for Payload {
208229 Payload :: SplunkHec ( ser) => ser. to_bytes ( rng, max_bytes, writer) ,
209230 Payload :: Static ( ser) => ser. to_bytes ( rng, max_bytes, writer) ,
210231 Payload :: StaticChunks ( ser) => ser. to_bytes ( rng, max_bytes, writer) ,
232+ Payload :: StaticTimestamped ( ser) => ser. to_bytes ( rng, max_bytes, writer) ,
211233 Payload :: Syslog ( ser) => ser. to_bytes ( rng, max_bytes, writer) ,
212234 Payload :: OtelTraces ( ser) => ser. to_bytes ( rng, max_bytes, writer) ,
213235 Payload :: OtelLogs ( ser) => ser. to_bytes ( rng, max_bytes, writer) ,
0 commit comments