Workflow Actions in Splunk enhance interactivity by allowing users to trigger external resources, run scripts, or execute additional searches directly from the search results. This guide will walk you through the details of creating and using Workflow Actions, providing examples and best practices for implementation.
Workflow Actions are custom interactions that you can configure in Splunk to:
Workflow Actions come in three types:
Action: Open an external log viewer.
URL Template:
http://logs.example.com?ip=$src_ip$
Behavior: Redirects the user to the specified URL, appending the value of the src_ip field.
Action: Report suspicious IPs.
Endpoint:
http://api.example.com/report
Fields Sent: src_ip, threat_level.
Behavior: Submits a POST request with these fields to the specified endpoint.
Action: View all logs for a specific user.
Search Query:
search user=$user_id$
Behavior: Opens a new search tab with the expanded query.
Action Name: View Detailed Logs
Type: GET
URI:
http://logs.example.com/view?session_id=$session_id$
Fields: session_id
Behavior: Redirects users to a URL that displays detailed logs for the specified session_id.
Action Name: Report Threat
Type: POST
URI:
http://security.example.com/report
Fields: src_ip, threat_level
Behavior: Sends a POST request with the specified fields to report a threat.
Action Name: Investigate User Activity
Type: Search
Query:
search index=user_logs user_id=$user_id$
Fields: user_id
Behavior: Executes a new search to retrieve all logs related to the specified user.
Define a GET action to open an external log viewer.
Name: Open Log Viewer
Type: GET
URI:
http://logs.example.com?log_id=$log_id$
Field: log_id
Task: Verify that clicking the action redirects to the correct URL.
Define a POST action to report a suspicious IP.
Name: Report Suspicious IP
Type: POST
URI:
http://api.example.com/report
Fields: src_ip, threat_level
Task: Verify that the POST request is sent with the correct data.
Define a search action to investigate logs for a specific user.
Name: Investigate User
Type: Search
Query:
search index=user_logs user_id=$user_id$
Field: user_id
Task: Verify that clicking the action initiates a search for the selected user.
Workflow Actions can incorporate multiple fields into their definitions, enabling more complex interactions.
Action Name: View Threat Details
Type: GET
URI:
http://security.example.com/details?ip=$src_ip$&severity=$threat_level$
Fields: src_ip, threat_level
Behavior: Redirects to a URL displaying threat details based on the source IP and threat level.
You can configure Workflow Actions to appear only for specific conditions, ensuring relevance to the data.
Condition:
threat_level="high"
Behavior: The action will only appear for events where threat_level is "high".
You can create Workflow Actions that link to specific Splunk dashboards, passing parameters as tokens.
Action Name: Investigate User Activity
Type: GET
URI:
/app/my_app/user_dashboard?user_id=$user_id$
Fields: user_id
Behavior: Redirects to the user_dashboard dashboard, pre-filtered by user_id.
Search-based Workflow Actions can trigger contextual searches within Splunk, enabling users to investigate related events.
Action Name: View Host Logs
Type: Search
Query:
search index=logs host=$host$
Fields: host
Behavior: Opens a search for all logs related to the selected host.
$ (e.g., $field_name$).Open Threat Report instead of Action1.Define a GET action for threat investigation.
Name: View Threat Analysis
Type: GET
URI:
http://analysis.example.com?ip=$src_ip$&severity=$threat_level$
Fields: src_ip, threat_level
Task: Verify that the action redirects to the correct URL with the provided parameters.
Define a Workflow Action that only appears for high-severity events.
Name: Report Critical Threat
Condition:
threat_level="high"
Type: POST
URI:
http://api.example.com/report
Fields: src_ip, threat_level
Task: Test the action with sample events and verify that it only appears for high-severity threats.
Define a GET action to link to a user activity dashboard.
Name: Investigate User
Type: GET
URI:
/app/my_app/user_dashboard?user_id=$user_id$
Fields: user_id
Task: Verify that clicking the action opens the dashboard filtered by user_id.
Define a search Workflow Action to view host-specific logs.
Name: Drill Down by Host
Type: Search
Query:
search index=logs host=$host$
Fields: host
Task: Verify that the search is executed with the correct field value.
Types of Workflow Actions:
Best Practices:
Advanced Configurations:
Although Workflow Actions can be scoped to specific apps or search contexts, controlling visibility based on user roles is crucial for enterprise environments.
Splunk uses metadata-based permissions to define who can view, edit, or execute a workflow action.
Visibility Settings can be configured via:
Splunk Web UI under Permissions when creating/editing a workflow action.
Or by editing the metadata file directly.
Only security analysts should access the “Report Threat” POST action.
Steps:
Create the Workflow Action normally.
Set permissions so only the security_analyst role can read or execute it.
metadata example:
[]
access = read : [ security_analyst ], write : [ admin ]
export = none
Always limit sensitive actions (like external POSTs or internal escalations) to specific roles.
Prevent unauthorized users from triggering or viewing sensitive data destinations.
GET actions append data (like usernames, IPs, session tokens) directly to the URL. These values are:
Visible in browser history
Stored in web server logs
Potentially exposed to third parties via URL sharing
Avoid passing sensitive or PII (personally identifiable information) via GET parameters.
Instead, use POST actions to safely encapsulate and transmit data in the request body.
Avoid:
http://example.com/report?user=$user$&session=$token$
This exposes user/session info in the URL.
Use instead (POST):
POST to http://example.com/report
Payload: { "user": "$user$", "session": "$token$" }
| Topic | Description |
|---|---|
| RBAC for Workflow Actions | Use Splunk metadata permissions to control visibility and execution based on user roles. |
| Secure GET/POST Usage | Avoid including sensitive data in GET URIs. Use POST or secure tokens for data privacy. |
When should a search workflow action be used instead of a GET or POST action?
When the workflow should trigger another Splunk search rather than an external request.
Search workflow actions allow users to launch new Splunk searches based on selected field values from an event. This helps analysts quickly pivot from one dataset to another while maintaining investigative context. For example, selecting a username from an event may trigger a search showing all activity associated with that user. Unlike GET or POST actions, which interact with external systems, search workflow actions remain entirely within the Splunk environment.
Demand Score: 62
Exam Relevance Score: 81
What is the difference between GET and POST workflow actions in Splunk?
GET workflow actions send parameters through the URL, while POST workflow actions send parameters within the request body.
GET workflow actions append field values as parameters in the URL when invoking an external service. This is useful for simple lookups or linking to external dashboards. POST workflow actions transmit parameters within the HTTP request body, which allows larger or more structured data to be sent securely. POST is typically used when interacting with APIs that require structured request payloads. Choosing the correct method depends on how the external system expects to receive data.
Demand Score: 65
Exam Relevance Score: 83
What is the purpose of workflow actions in Splunk?
Workflow actions allow users to trigger external actions or additional searches directly from event fields.
Workflow actions enable analysts to interact with data by linking field values to external systems or additional Splunk searches. When a user clicks a field value in search results, the workflow action can launch a new search, open a URL, or send a request to an external system. This allows deeper investigation workflows without manually copying field values into new queries. Workflow actions are commonly used for incident investigation, linking logs to ticketing systems, or running contextual searches.
Demand Score: 63
Exam Relevance Score: 82