Skip to main content

Usage

Description

The npx wgc audit-log stream set splunk-hec command streams the organization’s audit logs to a Splunk HTTP Event Collector (HEC). It creates the stream if none exists and replaces it otherwise. Every option that is left out is reset to its default, except the token, which keeps its stored value. Pass --index, --source and --sourcetype again on every call that should keep them. Use a HEC token with indexer acknowledgement disabled. See Streaming to Splunk HEC for the event format and delivery guarantees.

Required Options

The collector’s base URL, e.g. https://splunk.example.com:8088, or the full /services/collector/event URL. It must use HTTPS with a certificate from a trusted CA. localhost is not accepted.

Options

  • --token <token> : The HEC token. Required when creating the stream. Can also be set with the COSMO_HEC_TOKEN environment variable, which keeps it out of shell history. If left out, the stored token is kept.
  • --index <index> : The Splunk index to write to. If left out, events go to the token’s default index.
  • --source <source> : The Splunk source. Defaults to cosmo.
  • --sourcetype <sourcetype> : The Splunk sourcetype. Defaults to wundergraph:cosmo:audit.
  • --disabled : Saves the configuration without streaming. Running the command again without this flag enables the stream.

Examples

Streams audit logs to the cosmo index.
Pauses the stream, keeping the stored token.

Notes

  • The token is stored by Cosmo and is never returned. npx wgc audit-log stream get prints its last four characters.
  • Saving the configuration clears the last delivery error.
  • Entries written before the stream was configured are not sent.