Configuration options for LogBlock model instances.

These options define the metadata and boundaries for a log block, including line numbering, timing information, and stream identification. Used when creating new log blocks or updating existing block metadata.

Example: Basic Configuration

const blockOptions: LogBlockOptions = {
nodeId: 'primary',
stream: 'application-logs',
blockNum: 5,
startLineNum: 401,
endLineNum: 500,
startTime: new Date('2024-01-01T10:00:00Z'),
endTime: new Date('2024-01-01T10:05:00Z'),
lineCount: 100
};

const logBlock = LogBlock.instance('app-block-5')
.options(blockOptions)
.build();
interface LogBlockOptions {
    nodeId: string;
    stream: string;
    blockNum: number;
    startLineNum: number;
    endLineNum: number;
    startTime: Date;
    endTime: Date;
    lineCount: number;
}

Properties

nodeId: string

Node identifier where the log block originates.

Specifies which KOS device node contains this log block. Used for routing and organization in multi-node environments.

stream: string

Name of the log stream this block belongs to.

Identifies the parent stream that contains this block. Used for organization and cross-referencing with LogStreamModel.

blockNum: number

Sequential block number within the stream.

Used for ordering blocks chronologically within a stream. Blocks are automatically sorted by this number in containers.

startLineNum: number

Global line number where this block starts.

The first line number in this block relative to the entire stream. Used for accurate line numbering across the complete log stream.

endLineNum: number

Global line number where this block ends.

The last line number in this block relative to the entire stream. Used with startLineNum to define the block's line range.

startTime: Date

Timestamp when this log block period began.

Used for time-based filtering and analysis of log blocks.

endTime: Date

Timestamp when this log block period ended.

Used with startTime to define the temporal range of the block.

lineCount: number

Total number of log lines in this block.

Should equal (endLineNum - startLineNum + 1). Used for validation and progress tracking during block loading.