Comment on page
StackState Self-hosted v5.0.x
Health is collected from Splunk by executing Splunk saved searches from StackState Agent V2. In order to receive Splunk health data in StackState, configuration needs to be added to both Splunk and StackState Agent V2:
The Splunk Health check on StackState Agent V2 will execute all configured Splunk saved searches periodically to retrieve a snapshot of the health at the current time.
StackState Agent V2 executes the Splunk saved searches configured in the Splunk Health Agent check and pushes retrieved data to StackState. The following fields from the results of a saved search are sent to StackState:
Splunk query for components
| loadjob savedsearch=:disks
| search OrganizationPart="*" OrgGrp="*" company="*"
| table host disk available_pct
| eval check_state_id = strcat host "_" disk
| eval name = disk
| eval health = case(available_pct == 0, "critical", true, "clear")
| eval topology_element_identifier = host
| table check_state_id name health topology_element_identifier
To enable the Splunk Health integration and begin collecting health data from your Splunk instance, the Splunk Health check must be configured on StackState Agent V2. The check configuration provides all details required for the Agent to connect to your Splunk instance and execute a Splunk saved search.
To configure the Splunk Health Agent check:
- 1.Edit the StackState Agent V2 configuration file
- 2.Under instances, add details of your Splunk instance:
- url - The URL of your Splunk instance.
- ignore_saved_search_errors - Set to
falseto return an error if one of the configured saved searches does not exist. Default
- collection_interval - The interval at which the check is scheduled to run.
- 3.Under saved_searches, add details of each Splunk saved search that the check should execute to retrieve health information:
- name - The name of the Splunk saved search to execute.
- match - Regex used for selecting Splunk saved search queries. Default
- app - The Splunk app in which the saved searches are located. Default
- request_timeout_seconds - Default
- search_max_retry_count - Default
- search_seconds_between_retries - Default
- batch_size - Default
- parameters - Used in the Splunk API request. The default parameters provided make sure the Splunk saved search query refreshes. Default
- 5.Save the configuration file.
- 6.Restart StackState Agent V2 to apply the configuration changes.
- 7.Incoming health data will be mapped to associated components and relations in the StackState UI as check states.
collection_intervalwill be used as the
repeat_intervalfor the health synchronization. Make sure that the value set for the the
collection_intervalmatches the time that the check will take to run.
To disable the Splunk Health Agent check:
- 1.Remove or rename the Agent integration configuration file, for example:mv /etc/stackstate-agent/conf.d/splunk_health.d/conf.yaml /etc/stackstate-agent/conf.d/splunk_health.d/conf.yaml.bak
- 2.Restart StackState Agent V2 to apply the configuration changes.