vectordotdev/vector · error

message is required (make sure the "message" semantic…

Error message

message is required (make sure the "message" semantic meaning is set)

What it means

The Datadog events sink renames the log's message field to the Datadog 'text' event path. It relies on the global log schema's semantic meaning for 'message' being set; if the log has no event_path!\"text\" field and message_path() returns None, the expect panics.

Solutions

  1. Restore/keep the default log_schema.message_key ('message') in configuration
  2. Ensure upstream transforms do not remove the message field
  3. Set an explicit message_key in the datadog_events sink/log_schema config
  4. Enable semantic-meaning setting on custom events before sending

Example fix

// vector config
// before
log_schema:
  message_key: my_msg
// after
log_schema:
  message_key: message
Defensive patterns

Strategy: validation

Validate before calling

// ensure the log has a message semantic path before the sink
if !log.contains(event_path!("text")) && log.message_path().is_none() {
    return Err("log event has no message semantic meaning set");
}

Type guard

fn has_message(log: &LogEvent) -> bool { log.contains(event_path!("text")) || log.message_path().is_some() }

Try / catch

let message_path = log.message_path().ok_or_else(|| anyhow!("message semantic meaning not set"))?;

Prevention

When it happens

Trigger: A log event reaching the Datadog events sink that lacks a 'text' field AND whose log schema has no field carrying the 'message' semantic meaning.

Common situations: Custom log_schema.message_key configuration that removes or renames the message field; transforms that strip the message field before the sink; events constructed programmatically without semantic-meaning metadata.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16). Data as JSON: /api/errors/9bbc8adf94a6a69a. Report an issue: GitHub.

Appendix: source

Thrown at src/sinks/datadog/events/sink.rs:57

            })
            .into_driver(self.service)
            .run()
            .await
    }
}

async fn ensure_required_fields(event: Event) -> Option<Event> {
    let mut log = event.into_log();

    if !log.contains(event_path!("title")) {
        emit!(ParserMissingFieldError::<DROP_EVENT> { field: "title" });
        return None;
    }

    if !log.contains(event_path!("text")) {
        let message_path = log
            .message_path()
            .expect("message is required (make sure the \"message\" semantic meaning is set)")
            .clone();
        log.rename_key(&message_path, event_path!("text"));
    }

    if !log.contains(event_path!("host"))
        && let Some(host_path) = log.host_path().cloned().as_ref()
    {
        log.rename_key(host_path, event_path!("host"));
    }

    if !log.contains(event_path!("date_happened"))
        && let Some(timestamp_path) = log.timestamp_path().cloned().as_ref()
    {
        log.rename_key(timestamp_path, event_path!("date_happened"));
    }

    if !log.contains(event_path!("source_type_name"))
        && let Some(source_type_path) = log.source_type_path().cloned().as_ref()

View on GitHub (pinned to bdb87aeaa4)