Reference · Tools

Splunk

Interface with Splunk Enterprise for search job management, result retrieval, saved search (report) management, alert monitoring, and user administration.

Action Analytics v1

The Splunk node creates and manages search jobs, retrieves their results, manages saved searches and alerts, and administers users on a Splunk Enterprise instance. A typical build is running an SPL query on a schedule and routing anything it finds into an incident channel.

Node type
Action
Parameters
31
Outputs
Output, Error
Credentials
Splunk API

Splunk

Interface with Splunk Enterprise for search, alert, report, and user management.

Overview

Splunk is a log analytics and monitoring platform. This tool provides CRUD operations for search jobs, search results, saved searches (reports), fired alerts, alert metrics, and users via the Splunk REST API. Authentication uses a Bearer token. The API returns JSON when output_mode=json is set. Splunk commonly uses self-signed SSL certificates.

Category: Analytics
Tool Name: splunk
Version: 1

Appearance: Icon: si-splunk | Color: #65A637

Node Type

Action — processes input items and produces output

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires Splunk API credentials. See the Credentials Guide for setup instructions.

Resources

ResourceValue
Alertalert
Reportreport
Searchsearch
Useruser

Operations

Each resource has its own Operation list, and several resources reuse the value get or getAll. Pick the resource first, then the operation.

ResourceOperationValueDescription
AlertGet Fired AlertsgetReportRetrieve a fired alerts report
AlertGet MetricsgetMetricsRetrieve alert metrics
ReportCreate From SearchcreateCreate a search report from a search job
ReportDeletedeleteReportDelete a search report
ReportGetgetRetrieve a search report
ReportGet ManygetAllRetrieve many search reports
SearchCreatecreateCreate a search job
SearchDeletedeleteJobDelete a search job
SearchGetgetRetrieve a search job
SearchGet ManygetAllRetrieve many search jobs
SearchGet ResultgetResultGet the result of a search job
UserCreatecreateCreate a user
UserDeletedeleteUserDelete a user
UserGetgetRetrieve a user
UserGet ManygetAllRetrieve many users
UserUpdateupdateUpdate a user

Parameters

The Alert operations Get Fired Alerts and Get Metrics take no parameters of their own.

Search: Create

ParameterTypeRequiredDefaultDescription
Query (search)stringYesSearch language string to execute, in Splunk Search Processing Language (SPL). For example search index=_internal | stats count by source.
Additional Fields (additionalFields)collectionNo{}Optional search-job settings sent with the dispatch.
— Ad Hoc Search LeveloptionsNoverbose
Options: fast, smart, verbose
— Auto-Cancel After (Seconds)numberNo0Seconds after which the search job automatically cancels.
— Auto-Finalize After (Num Events)numberNo0Auto-finalize the search after at least this many events are processed.
— Auto Pause After (Seconds)numberNo0Seconds of inactivity after which the search job automatically pauses.
— Earliest IndexstringNoThe earliest index time for the search (inclusive). ISO 8601 datetime string.
— Earliest TimestringNoThe earliest cut-off for the search (inclusive). ISO 8601 datetime string.
— Exec ModeoptionsNoblocking
Options: blocking, normal, oneshot
— Indexed Real Time OffsetnumberNo0Seconds of disk sync delay for indexed real-time search.
— Latest IndexstringNoThe latest index time for the search (inclusive). ISO 8601 datetime string.
— Latest TimestringNoThe latest cut-off for the search (inclusive). ISO 8601 datetime string.
— Max TimenumberNo0Number of seconds to run this search before finalizing. Set 0 to never finalize.
— NamespacestringNoApplication namespace in which to restrict searches.
— Reduce FrequencynumberNo0How frequently to run the MapReduce reduce phase on accumulated map values.
— Remote Server ListstringNoComma-separated list of (possibly wildcarded) servers from which raw events should be pulled.
— Reuse Limit (Seconds)numberNo0Number of seconds ago to check when an identical search is started and return the job search ID instead of starting a new job.
— Required FieldstringNoName of a required field to add to the search.
— Search ModeoptionsNonormal
Options: normal, realtime
— Status BucketsnumberNo0The most status buckets to generate. Set 0 to generate no timeline information.
— TimeoutnumberNo86400Number of seconds to keep this search after processing has stopped.
— Workload PoolstringNoNew workload pool where the existing running search should be placed.

Search: Delete

ParameterTypeRequiredDefaultDescription
Search Job IDstringYesThe ID of the search job.

Search: Get

ParameterTypeRequiredDefaultDescription
Search Job IDstringYesThe ID of the search job.

Search: Get Many

ParameterTypeRequiredDefaultDescription
Return AllbooleanNofalseWhether to return all results or only up to a given limit.
LimitnumberNo50Max number of results to return. (shown when Return All is false)
SortfixedCollectionNo{}How the returned job list is ordered.
— Sort DirectionoptionsNoasc
Options: asc, desc
— Sort KeystringNoKey name to use for sorting.
— Sort ModeoptionsNoauto
Options: auto (numeric when every value is numeric, otherwise alphabetic), alpha (alphabetic, case-insensitive), alpha_case (alphabetic, case-sensitive), num (numeric)

Search: Get Result

ParameterTypeRequiredDefaultDescription
Search Job IDstringYesThe ID of the search job.
Return AllbooleanNofalseWhether to return all results or only up to a given limit.
LimitnumberNo50Max number of results to return. (shown when Return All is false)
Filters (filters)collectionNo{}Narrow the rows the job returns.
— Key-Value MatchfixedCollectionNo{}Filter results by matching a specific field value. Only results where the specified key equals the specified value will be returned.
— — KeystringNoKey to match against.
— — ValuestringNoValue to match against.
Options (options)collectionNo{}Extra result-retrieval settings.
— Add Summary to MetadatabooleanNofalseWhether to include field summary statistics in the response.
ParameterTypeRequiredDefaultDescription
Search Job IDstringYesThe ID of the search job to create a report from.
NamestringNoThe name of the report.

Report: Delete

ParameterTypeRequiredDefaultDescription
Report IDstringYesThe ID (name) of the saved search report. Find this in Splunk under Settings > Searches, reports, and alerts.

Report: Get

ParameterTypeRequiredDefaultDescription
Report IDstringYesThe ID (name) of the saved search report. Find this in Splunk under Settings > Searches, reports, and alerts.

Report: Get Many

ParameterTypeRequiredDefaultDescription
Return AllbooleanNofalseWhether to return all results or only up to a given limit.
LimitnumberNo50Max number of results to return. (shown when Return All is false)
Options (options)collectionNo{}Extra listing settings.
— Add Orphan FieldbooleanNofalseWhether to include a boolean value for each saved search to show whether the search is orphaned (has no valid owner).
— List Default ActionsbooleanNofalseWhether to list default action arguments.

User: Create

ParameterTypeRequiredDefaultDescription
NamestringYesLogin name of the user.
RolesstringYesuserComma-separated list of roles to assign to the user. Available roles can be found in Splunk under Settings > Access controls > Roles. Common roles: admin, power, user.
PasswordstringYesPassword for the new user.
Additional Fields (additionalFields)collectionNo{}Optional profile fields for the new user.
— EmailstringNo
— Full Name (realname)stringNoFull name of the user.

User: Delete

ParameterTypeRequiredDefaultDescription
User IDstringYesThe login name (ID) of the user.

User: Get

ParameterTypeRequiredDefaultDescription
User IDstringYesThe login name (ID) of the user.

User: Get Many

ParameterTypeRequiredDefaultDescription
Return AllbooleanNofalseWhether to return all results or only up to a given limit.
LimitnumberNo50Max number of results to return. (shown when Return All is false)

User: Update

ParameterTypeRequiredDefaultDescription
User IDstringYesThe login name (ID) of the user to update.
Update Fields (updateFields)collectionNo{}User fields to change. Only the fields you add are sent.
— EmailstringNo
— Full Name (realname)stringNoFull name of the user.
— PasswordstringNoNew password for the user.
— RolesstringNoComma-separated list of roles to assign. Available roles can be found in Splunk under Settings > Access controls > Roles.

All Operations

ParameterTypeRequiredDefaultDescription
Max ConcurrencynumberNo10Maximum number of items to process concurrently. Accepts 1–100.

Output Data

Splunk’s response is merged onto the input item’s JSON at the top level — the returned fields sit alongside the fields the item already carried, so downstream nodes address them directly ({{ $json.sid }}). A response field with the same name as an existing item field overwrites it. Binary data on the input item is forwarded unchanged onto every output item.

Multi-record responses fan out. When Splunk returns a list, each record becomes its own output item — still merged onto the same input JSON — so one input item can produce many output items. A list with no records produces no output items for that input.

OperationsOutput
Alert Get Fired Alerts and Get Metrics; Report Get Many; Search Get Many; User Get ManyOne output item per record in the list.
Search Get ResultOne output item per result row the job returned.
Search Create and Get; Report Create From Search and Get; User Create, Get and UpdateOne output item carrying the returned object.
Search Delete; Report Delete; User DeleteOne output item carrying success: true — these calls confirm the change instead of returning a record.

Records that Splunk returns as REST entries — search jobs, saved searches, users, alerts — are flattened before they reach you: the nested content block is lifted to the top level so its fields sit beside name and author, id is shortened to just the final path segment, and the full REST URL is kept as entryUrl. Search Get Result rows are the raw result fields and are not flattened this way.

Search Create returns the dispatched job, whose sid is the search job ID every other search operation needs — pass it on as {{ $json.sid }}.

Usage Examples

  • Create a Splunk search job with an SPL query
  • Get results from a completed Splunk search job
  • List all fired alerts in Splunk
  • Create a saved search report from a search job
  • Create a new Splunk user with specific roles
  • Update a Splunk user email or roles

Example Configuration

Dispatch a search job and wait for it to finish:

{
  "type": "splunk",
  "parameters": {
    "resource": "search",
    "operation": "create",
    "search": "search index=main sourcetype=access_combined | head 100",
    "additionalFields": {
      "earliest_time": "-24h",
      "latest_time": "now",
      "exec_mode": "blocking",
      "timeout": 300
    }
  }
}

Read the rows back from the job the previous node created, keeping only successful requests:

{
  "type": "splunk",
  "parameters": {
    "resource": "search",
    "operation": "getResult",
    "searchJobId": "{{ $json.sid }}",
    "returnAll": false,
    "limit": 50,
    "filters": {
      "keyValueMatch": {
        "keyValuePair": {
          "key": "status",
          "value": "200"
        }
      }
    },
    "options": {
      "add_summary_to_metadata": true
    }
  }
}

List recent search jobs, newest dispatch first:

{
  "type": "splunk",
  "parameters": {
    "resource": "search",
    "operation": "getAll",
    "returnAll": false,
    "limit": 25,
    "sort": {
      "values": {
        "sort_key": "dispatch_time",
        "sort_dir": "desc",
        "sort_mode": "auto"
      }
    }
  }
}

Save a finished search job as a report:

{
  "type": "splunk",
  "parameters": {
    "resource": "report",
    "operation": "create",
    "searchJobId": "{{ $json.sid }}",
    "name": "Daily Access Report"
  }
}

List saved searches and flag the orphaned ones:

{
  "type": "splunk",
  "parameters": {
    "resource": "report",
    "operation": "getAll",
    "returnAll": false,
    "limit": 20,
    "options": {
      "add_orphan_field": true,
      "listDefaultActionArgs": false
    }
  }
}

Create a user with roles and profile details:

{
  "type": "splunk",
  "parameters": {
    "resource": "user",
    "operation": "create",
    "name": "john.doe",
    "password": "{{ $json.temporaryPassword }}",
    "roles": "power,user",
    "additionalFields": {
      "email": "john.doe@company.com",
      "realname": "John Doe"
    }
  }
}

Update a user’s contact details:

{
  "type": "splunk",
  "parameters": {
    "resource": "user",
    "operation": "update",
    "userId": "john.doe",
    "updateFields": {
      "email": "john.doe@newcompany.com",
      "realname": "John D. Doe"
    }
  }
}

Pull the fired-alerts report:

{
  "type": "splunk",
  "parameters": {
    "resource": "alert",
    "operation": "getMetrics"
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

Use Splunk to create and manage search jobs, retrieve search results, manage saved searches (reports), monitor alerts, and administer users on a Splunk Enterprise instance.

The Search Workflow Pattern

  1. Create a search job with your SPL query. Leave Exec Mode on blocking so the node returns only once Splunk has finished, and read the job’s sid from the output.
  2. Get Result with that sid to retrieve the rows, one output item per row.
  3. Optionally Create From Search to save the same query as a report you can schedule inside Splunk.

Get on a search job is useful in between when you dispatch with normal mode and want to inspect the job’s progress before reading results.

Key Parameter Dependencies

  • The Operation list depends entirely on the selected Resource.
  • Limit only appears when Return All is off. Turning Return All on asks Splunk for the complete set.
  • Collections (Additional Fields, Update Fields, Filters, Options) are flat objects keyed by the sub-field’s internal name.
  • The Sort fixed collection nests under the group key values, and Key-Value Match nests under keyValuePair. Both hold a single record, not a list.

Frequently asked questions

What is the correct search pattern?

Create a search job with your SPL query, leaving Exec Mode on `blocking` so the node returns only once Splunk has finished, then read the job's `sid` from the output and use Get Result with that `sid` to retrieve the rows.

Why use blocking exec mode?

Because otherwise the node returns before results exist, and the follow-up fetch finds nothing. Blocking trades a longer node run for a result you can actually use.

What can it manage besides searches?

Saved searches (reports), alerts and users, so both the analytics and the administration sides are reachable.

Which credential does it need?

A Splunk API credential for the instance.

Build with the Splunk node

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need Splunk API credentials first.

Open BusyBot

Last updated . Spotted something wrong? Tell us.