Skip to main content

validate_event

Function validate_event 

Source
pub fn validate_event(
    line: &str,
    line_num: usize,
) -> Result<(), ValidationError>
Expand description

Validate a single TSJSON event line.

Performs all three levels of validation:

  1. Syntax: correct tab-separated field count, valid timestamp, valid event hash format and value.
  2. Schema: valid JSON payload matching the event type.
  3. Semantic: valid item ID, non-empty agent/itc, valid parent hashes, payload size under limit.

Comment lines (starting with #) and blank lines return Ok(()).

ยงErrors

Returns a ValidationError describing the first failure found.