Note
This callback plugin is part of the community.general collection (version 10.7.3).
You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.general. You need further requirements to be able to use this callback plugin, see Requirements for details.
To use it in a playbook, specify: community.general.splunk.
This plugin is a notification callback. It sends information for a playbook run to other applications, services, or systems. See Callback plugins for more information on callback plugins.
The below requirements are needed on the local controller node that executes this callback.
ansible.cfg
Parameter | Comments |
|---|---|
authtoken string | Token to authenticate the connection to the Splunk HTTP collector. Configuration:
|
batch string added in community.general 3.3.0 | Correlation ID which can be set across multiple playbook executions. Configuration:
|
include_milliseconds boolean added in community.general 2.0.0 | Whether to include milliseconds as part of the generated timestamp field in the event sent to the Splunk HTTP collector. Choices:
Configuration:
|
url string | URL to the Splunk HTTP collector source. Configuration:
|
validate_certs boolean added in community.general 1.0.0 | Whether to validate certificates for connections to HEC. It is not recommended to set to Choices:
Configuration:
|
Note
Configuration entries listed above for each entry type (Ansible variable, environment variable, and so on) have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up. The entry types are also ordered by precedence from low to high priority order. For example, an ansible.cfg entry (further up in the list) is overwritten by an Ansible variable (further down in the list).
examples: >-
To enable, add this to your ansible.cfg file in the defaults block
[defaults]
callback_whitelist = community.general.splunk
Set the environment variable
export SPLUNK_URL=http://mysplunkinstance.datapaas.io:8088/services/collector/event
export SPLUNK_AUTHTOKEN=f23blad6-5965-4537-bf69-5b5a545blabla88
Set the ansible.cfg variable in the callback_splunk block
[callback_splunk]
url = http://mysplunkinstance.datapaas.io:8088/services/collector/event
authtoken = f23blad6-5965-4537-bf69-5b5a545blabla88
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/general/splunk_callback.html