SPLK-1001 practice question 12 of 30

When an alert action is configured to run a script, Splunk must be able to locate the script. Which is one of the directories Splunk will look in to find the script?

Full set: 244 questions

Domain Creating and Using Alerts

Answer options
A: $SPLUNK_HOME/bin/scripts Correct answer
B: $SPLUNK_HOME/etc/scripts
C: $SPLUNK_HOME/bin/etc/scripts
D: $SPLUNK_HOME/etc/scripts/bin
Correct Answer:
A. $SPLUNK_HOME/bin/scripts
Explanation

For security and operational integrity, Splunk Enterprise requires that any script triggered by an alert action be located in a specific, recognized directory. The primary system-level directory for these scripts is $SPLUNKHOME/bin/scripts. Placing a script in this location makes it available for selection when configuring the "Run a script" alert action. Splunk also searches for scripts within an app's context at $SPLUNKHOME/etc/apps//bin/scripts, but $SPLUNKHOME/bin/scripts is the correct system-wide location listed in the options.

Why Incorrect

B. $SPLUNKHOME/etc/scripts: The $SPLUNKHOME/etc/ directory is primarily intended for configuration files (.conf), not executable scripts for alert actions.
C. $SPLUNKHOME/bin/etc/scripts: This is an invalid directory path. The etc directory is not a subdirectory of bin in the standard Splunk file system structure.
D. $SPLUNKHOME/etc/scripts/bin: This is also an invalid directory path within the standard Splunk file system structure.

References

1. Splunk Enterprise Documentation, Alerting Manual, "Set up alert actions": In the subsection detailing the "Run a script" action, the documentation explicitly states: "Place the script that you want the alert to run in one of the following locations: $SPLUNKHOME/bin/scripts or $SPLUNKHOME/etc/apps//bin/scripts." This directly confirms that option A is a correct location.

2. Splunk Enterprise Documentation, Admin Manual, "App architecture and object ownership": This section describes the standard Splunk directory structure. It clarifies that the bin directory contains executable files, including scripts, while the etc directory is for system and app configurations. This supports the distinction between the roles of the bin and etc directories.

Scroll to Top