Splunk HTTP Event Collector (HEC) Source

The Vector splunk_hec source receives logs from Splunk.

Configuration

[sources.my_source_id]
type = "splunk_hec" # required
address = "0.0.0.0:8080" # optional, default
token = "A94A8FE5CCB19BA61C4C08" # optional, no default
  • commonoptionalstring

    address

    The address to accept connections on.

    • Syntax: literal
    • Default: "0.0.0.0:8080"
  • optionaltable

    tls

    Configures the TLS options for incoming connections.

    • optionalstring

      ca_file

      Absolute path to an additional CA certificate file, in DER or PEM format (X.509), or an in-line CA certificate in PEM format.

      • Syntax: literal
    • optionalstring

      crt_file

      Absolute path to a certificate file used to identify this server, in DER or PEM format (X.509) or PKCS#12, or an in-line certificate in PEM format. If this is set, and is not a PKCS#12 archive, key_file must also be set. This is required if enabled is set to true.

      • Syntax: literal
    • optionalbool

      enabled

      Require TLS for incoming connections. If this is set, an identity certificate is also required.

      • Default: false
    • optionalstring

      key_file

      Absolute path to a private key file used to identify this server, in DER or PEM format (PKCS#8), or an in-line private key in PEM format.

      • Syntax: literal
    • optionalstring

      key_pass

      Pass phrase used to unlock the encrypted key file. This has no effect unless key_file is set.

      • Syntax: literal
    • optionalbool

      verify_certificate

      If true, Vector will require a TLS certificate from the connecting host and terminate the connection if the certificate is not valid. If false (the default), Vector will not request a certificate from the client.

      • Default: false
  • commonoptionalstring

    token

    If supplied, incoming requests must supply this token in the Authorization header, just as a client would if it was communicating with the Splunk HEC endpoint directly. If not supplied, the Authorization header will be ignored and requests will not be authenticated.

    • Syntax: literal

Output

This component outputs log events with the following fields:

{
"message" : "2019-02-13T19:48:34+00:00 [info] Started GET \"/\" for 127.0.0.1",
"splunk_channel" : "2020-10-10T17:07:36+00:00",
"timestamp" : "2020-10-10T17:07:36+00:00"
}
  • commonrequiredstring

    message

    The raw line, unparsed.

    • Syntax: literal
  • commonrequiredtimestamp

    splunk_channel

    The Splunk channel, value of the X-Splunk-Request-Channel header or channel query parameter, in that order of precedence.

  • commonrequiredtimestamp

    timestamp

    The exact time the event was ingested into Vector.

Telemetry

This component provides the following metrics that can be retrieved through the internal_metrics source. See the metrics section in the monitoring page for more info.

  • counter

    events_in_total

    The number of events accepted by this component either from tagged origin like file and uri, or cumulatively from other origins. This metric includes the following tags:

    • component_kind - The Vector component kind.

    • component_name - The Vector component ID.

    • component_type - The Vector component type.

    • container_name - The name of the container from which the event originates.

    • file - The file from which the event originates.

    • instance - The Vector instance identified by host and port.

    • job - The name of the job producing Vector metrics.

    • mode - The connection mode used by the component.

    • peer_addr - The IP from which the event originates.

    • peer_path - The pathname from which the event originates.

    • pod_name - The name of the pod from which the event originates.

    • uri - The sanitized uri from which the event originates.

  • counter

    http_request_errors_total

    The total number of HTTP request errors for this component. This metric includes the following tags:

    • instance - The Vector instance identified by host and port.

    • job - The name of the job producing Vector metrics.

  • counter

    events_out_total

    The total number of events emitted by this component. This metric includes the following tags:

    • component_kind - The Vector component kind.

    • component_name - The Vector component ID.

    • component_type - The Vector component type.

    • instance - The Vector instance identified by host and port.

    • job - The name of the job producing Vector metrics.

  • counter

    requests_received_total

    The total number of requests received by this component. This metric includes the following tags:

    • component_kind - The Vector component kind.

    • component_name - The Vector component ID.

    • component_type - The Vector component type.

    • instance - The Vector instance identified by host and port.

    • job - The name of the job producing Vector metrics.

How It Works

Context

By default, the splunk_hec source will augment events with helpful context keys as shown in the "Output" section.

State

This component is stateless, meaning its behavior is consistent across each input.

Transport Layer Security (TLS)

Vector uses Openssl for TLS protocols. You can adjust TLS behavior via the tls.* options.