Splunk · Arazzo Workflow

Splunk Run a Search Job and Retrieve Results

Version 1.0.0

Dispatch an SPL search, poll the job until it finishes, then read the results.

1 workflow 1 source API 1 provider
View Spec View on GitHub AnalyticsData AnalysisLoggingMachine DataMonitoringObservabilityPlatformSecuritySIEMArazzoWorkflows

Provider

splunk

Workflows

run-search-job
Create a search job, poll it to completion, and fetch its results.
Submits an SPL search as an asynchronous job, repeatedly reads the job's dispatchState until it reaches DONE, then pulls back the paginated results in JSON.
3 steps inputs: count, earliest_time, latest_time, search outputs: resultCount, results, sid
1
createJob
createSearchJob
Dispatch the SPL search as an asynchronous search job and capture the assigned search ID (sid).
2
pollJob
getSearchJob
Read the search job status. The job is finished when dispatchState reports DONE; otherwise the step is retried.
3
getResults
getSearchResults
Retrieve the transformed results of the completed search job in JSON, paginated by count and offset.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Splunk Run a Search Job and Retrieve Results
  summary: Dispatch an SPL search, poll the job until it finishes, then read the results.
  description: >-
    The canonical Splunk search pattern. A search job is created from an SPL
    query, which runs asynchronously on the search head. The workflow polls the
    job's dispatch state until it reports DONE, then retrieves the transformed
    results. Every step spells out its request inline so the flow can be read
    and executed without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: splunkApi
  url: ../openapi/splunk-enterprise-rest-api.yml
  type: openapi
workflows:
- workflowId: run-search-job
  summary: Create a search job, poll it to completion, and fetch its results.
  description: >-
    Submits an SPL search as an asynchronous job, repeatedly reads the job's
    dispatchState until it reaches DONE, then pulls back the paginated results
    in JSON.
  inputs:
    type: object
    required:
    - search
    properties:
      search:
        type: string
        description: The SPL search query to execute (e.g. "search index=main | head 100").
      earliest_time:
        type: string
        description: Earliest time boundary for the search (e.g. "-24h@h").
      latest_time:
        type: string
        description: Latest time boundary for the search (e.g. "now").
      count:
        type: integer
        description: Maximum number of results to return.
  steps:
  - stepId: createJob
    description: >-
      Dispatch the SPL search as an asynchronous search job and capture the
      assigned search ID (sid).
    operationId: createSearchJob
    parameters:
    - name: output_mode
      in: query
      value: json
    requestBody:
      contentType: application/x-www-form-urlencoded
      payload:
        search: $inputs.search
        earliest_time: $inputs.earliest_time
        latest_time: $inputs.latest_time
        exec_mode: normal
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      sid: $response.body#/sid
  - stepId: pollJob
    description: >-
      Read the search job status. The job is finished when dispatchState
      reports DONE; otherwise the step is retried.
    operationId: getSearchJob
    parameters:
    - name: search_id
      in: path
      value: $steps.createJob.outputs.sid
    - name: output_mode
      in: query
      value: json
    successCriteria:
    - condition: $statusCode == 200
    - context: $response.body
      condition: $.content.dispatchState == "DONE"
      type: jsonpath
    outputs:
      dispatchState: $response.body#/content/dispatchState
      resultCount: $response.body#/content/resultCount
      isDone: $response.body#/content/isDone
    onSuccess:
    - name: jobDone
      type: goto
      stepId: getResults
      criteria:
      - context: $response.body
        condition: $.content.dispatchState == "DONE"
        type: jsonpath
    onFailure:
    - name: retryPoll
      type: retry
      retryAfter: 2
      retryLimit: 30
      criteria:
      - condition: $statusCode == 200
  - stepId: getResults
    description: >-
      Retrieve the transformed results of the completed search job in JSON,
      paginated by count and offset.
    operationId: getSearchResults
    parameters:
    - name: search_id
      in: path
      value: $steps.createJob.outputs.sid
    - name: output_mode
      in: query
      value: json
    - name: count
      in: query
      value: $inputs.count
    - name: offset
      in: query
      value: 0
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      results: $response.body#/results
      fields: $response.body#/fields
      initOffset: $response.body#/init_offset
  outputs:
    sid: $steps.createJob.outputs.sid
    resultCount: $steps.pollJob.outputs.resultCount
    results: $steps.getResults.outputs.results

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/splunk-run-search-job-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.